<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;A0QEQX44fip7ImA9WhRUF0U.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874</id><updated>2012-01-29T00:21:40.036+02:00</updated><category term="DELL" /><category term="Visual Studio" /><category term="P2015dn" /><category term="bootsect" /><category term="WIF" /><category term="Keyboard Layout" /><category term="XP" /><category term="Compcln" /><category term="SilverLight" /><category term="windows Vista" /><category term="Microsoft Robotics Studio" /><category term="OMCI" /><category term="dotnetnuke" /><category term="GRUB2" /><category term="repair boot sector" /><category term="Custom Configuration Section" /><category term="Windows" /><category term="Boot sector" /><category term="IHttpModule" /><category term="SSMS" /><category term="HP LaserJet" /><category term="βουδαπέστη" /><category term="dnn" /><category term="GRUB" /><category term="mingw" /><category term="MVPL" /><category term="Node js" /><category term="Duplex Printing" /><category term="virtual pc" /><category term="Conference" /><category term="gyp" /><category term="membership" /><category term="openvpn" /><category term="tapi3" /><category term="VCARD" /><category term="Windows Sharepoint Services 3.0" /><category term="Node modules" /><category term="Federation" /><category term="Startup" /><category term="vpnuk" /><category term="manual" /><category term="Windows 7" /><category term="linux" /><category term="debug" /><category term="Big Blue Button" /><category term="Metadata" /><category term="Worm" /><category term="MySQL" /><category term="dos script" /><category term="Custom STS" /><category term="msys" /><category term="security" /><category term="Windows Identity Foundation" /><category term="reset password" /><category term="2007" /><category term="Claims Based Security" /><category term="IIS" /><category term="porting code" /><category term="C#" /><category term="VB.net" /><category term="disk space" /><category term="tapi" /><category term="SEO" /><category term="UAC" /><category term="Remix" /><category term="Input Languages" /><category term="save-password option" /><category term="teleon" /><category term="Authentication" /><category term="routing" /><category term="BSOD" /><category term="asp.net" /><category term="Language bar" /><category term="Ubuntu" /><category term="Trojan" /><category term="skype voice gateway" /><category term="VS2005" /><category term="Url rewrite" /><category term="MBR" /><title>Botsikas' Blog</title><subtitle type="html">Technological blog publishing tricky IT solutions</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://botsikas.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>47</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/BotsikasBlog" /><feedburner:info uri="botsikasblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DUABRHsyfSp7ImA9WhRQGUU.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-2287241550851521067</id><published>2011-12-16T00:21:00.001+02:00</published><updated>2011-12-16T00:22:35.595+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-16T00:22:35.595+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="debug" /><category scheme="http://www.blogger.com/atom/ns#" term="Node js" /><title>Debugging a node.js app in windows (no eclipse)</title><content type="html">&lt;p&gt;If you don’t want to install eclipse and google dev tools to debug your node.js app you may use &lt;a href="https://github.com/dannycoates/node-inspector" target="_blank"&gt;node inspector&lt;/a&gt; which is a node.js app that resembles google chrome’s dev tools. You start your node app passing the –debug-brk (or –debug if you don’t care about the first lines of code) and then fire up node inspector and debug the app. I actually have node inspector running all the time and I simply refresh the webpage when I reload the application.&lt;/p&gt;  &lt;p&gt;Happy debugging…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-2287241550851521067?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/l7obb18mOdI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/2287241550851521067/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=2287241550851521067" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/2287241550851521067?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/2287241550851521067?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/l7obb18mOdI/debugging-nodejs-app-in-windows-no.html" title="Debugging a node.js app in windows (no eclipse)" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/12/debugging-nodejs-app-in-windows-no.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcGR386cCp7ImA9WhRQGUU.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-4006169864836754507</id><published>2011-12-15T23:51:00.001+02:00</published><updated>2011-12-15T23:53:46.118+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-15T23:53:46.118+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="porting code" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><title>strcasecmp: identifier not found when porting from linux to windows</title><content type="html">&lt;p&gt;Ever tried to port from linux to windows and got the :&lt;/p&gt;  &lt;p&gt;error C3861: 'strcasecmp': identifier not found&lt;/p&gt;  &lt;p&gt;The easiest workaround is to add a&amp;#160; conditional define (visual studio add the –D _WIN32 or _WIN64 depending your OS) and define the following mappings:&lt;/p&gt;  &lt;p&gt;#if defined(_WIN32) || defined(_WIN64)   &lt;br /&gt;&amp;#160; #define snprintf _snprintf    &lt;br /&gt;&amp;#160; #define vsnprintf _vsnprintf    &lt;br /&gt;&amp;#160; #define strcasecmp _stricmp    &lt;br /&gt;&amp;#160; #define strncasecmp _strnicmp    &lt;br /&gt;#endif&lt;/p&gt;  &lt;p&gt;Another common missing identifier is the Uint which can be solved adding:&lt;/p&gt;  &lt;p&gt;#define uint=unsigned int&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-4006169864836754507?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/TbGW-VkXfOo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/4006169864836754507/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=4006169864836754507" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/4006169864836754507?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/4006169864836754507?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/TbGW-VkXfOo/strcasecmp-identifier-not-found-when.html" title="strcasecmp: identifier not found when porting from linux to windows" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/12/strcasecmp-identifier-not-found-when.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMBRHY_fSp7ImA9WhRQGUU.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-4365538507070476266</id><published>2011-12-15T23:27:00.001+02:00</published><updated>2011-12-15T23:27:35.845+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-15T23:27:35.845+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Node js" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><category scheme="http://www.blogger.com/atom/ns#" term="Node modules" /><title>Debugging native node modules loading failure on windows</title><content type="html">&lt;p&gt;If you ever need to build a module that requires another library (e.g. openssl, ict, expat etc) you may receive an “Out of memory” error when you require the file. This is unfortunately a generic error on windows but you can fire up visual studio and debug node (attaching to a process) and you can can see there the exact system error number (sys_errno) by adding a breakpoint in deps\uv\src\win\error.c when uv translates the error code (uv_translate_sys_error). &lt;/p&gt;  &lt;p&gt;In my case I was receiving the 126 error code which I looked up at &lt;a title="http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx" href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx&lt;/a&gt; and then I figured that I hadn’t restarted the console after I added the referring dll file path in my enviroment PATH variable… I opened a new console, verified that the dll’s path is in my PATH variable and the module loaded just fine…&lt;/p&gt;  &lt;p&gt;Hope this helps a bit when you try to debug weird loading errors.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-4365538507070476266?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/7EvgWAw-T1k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/4365538507070476266/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=4365538507070476266" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/4365538507070476266?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/4365538507070476266?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/7EvgWAw-T1k/debugging-native-node-modules-loading.html" title="Debugging native node modules loading failure on windows" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/12/debugging-native-node-modules-loading.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MMRXw5eSp7ImA9WhRXEUg.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-2775009502248866546</id><published>2011-12-14T08:37:00.001+02:00</published><updated>2011-12-17T21:51:24.221+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-17T21:51:24.221+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Node js" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><category scheme="http://www.blogger.com/atom/ns#" term="Node modules" /><category scheme="http://www.blogger.com/atom/ns#" term="gyp" /><category scheme="http://www.blogger.com/atom/ns#" term="dos script" /><title>Node.js modules cross platform compilation using gyp</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;&lt;i&gt;Update: &lt;a href="https://github.com/joyent/node/pull/2337" target="_blank"&gt;I have made a pull request where you can find the updated tools discussed in this article, located here&lt;/a&gt;&lt;/i&gt;&lt;/b&gt;&lt;br/&gt;
Node.js has been using &lt;a href="http://code.google.com/p/waf/" target="_blank"&gt;waf&lt;/a&gt; (node-waf) to configure and build modules up to version 0.4. From v0.6 and on, the team has moved on to &lt;a href="http://code.google.com/p/gyp/" target="_blank"&gt;gyp (Generate Your Projects)&lt;/a&gt; which seems to be a bit more promising when it comes to cross platform compilation. This post shows how to create a simply gyp file to build your own custom native node.js modules and provides some scripts to automate the project generation process.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
A bit of history&lt;/h2&gt;
Gyp is a google project that was created to support cross platform building of the &lt;a href="http://www.chromium.org/" target="_blank"&gt;opensource chromium project&lt;/a&gt;. The main target of this project is to “generate native Visual Studio, Xcode and SCons and/or make build files from a platform-independent input format”. The project is still on its very first steps and there is little documentation on how to use it. Moreover, up to this point, there are thousand of feature requests and the maintaining team seems to implement only those directly related to the chromium project, which makes it a bit hard to upstream any new feature unless you are persistent.    &lt;br /&gt;On the bright side, gyp works pretty well once you get a handle of it. If you read the &lt;a href="http://code.google.com/p/gyp/wiki/GypLanguageSpecification" target="_blank"&gt;gyp language specification&lt;/a&gt; and use the source as your guide (“may the source be with you”) you will be able to write your own gyp files for your personal cross platform projects in no time.    &lt;br /&gt;
&lt;h2&gt;
Node-waf vs gyp&lt;/h2&gt;
Up to version 0.4 the node.js team offered node-waf (a &lt;a href="http://code.google.com/p/waf/" target="_blank"&gt;waf&lt;/a&gt; 1.5.3 wrapper script) to configure and build modules for node.js. This was fine since in windows there was no native support and you had to use Cygwin to make your builds. From version 0.5 and on, there node supports native windows builds which brings visual studio in to play. The problem is that waf started supporting visual studio’s msbuild from version 1.6 and on and this was a major setback. In the meanwhile the node.js team decided to move on to gyp and abandoned the node-waf script. If you are tempted to create a node-waf wrapping waf 1.6, try to resist. A lot of things have changed in waf 1.6 and when I finished modifying the script, I still couldn’t generate proper windows builds (I would have to hardwire the linking arguments in order to link the object to node.lib just for windows). On the other hand, gyp supports custom arguments depending on the building platform which makes the gyp files easier to maintain.&lt;br /&gt;
&lt;h2&gt;
Node Module’s gyp file&lt;/h2&gt;
I have edited a simple gyp file (see the end of this post for source code) to compile the simple hello world native nodejs module I have used in my previous posts (&lt;a href="http://botsikas.blogspot.com/2011/12/building-native-modules-for-nodejs-06.html" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="http://botsikas.blogspot.com/2011/12/building-simple-native-nodejs-module-on.html" target="_blank"&gt;here&lt;/a&gt;). This gyp files specifies a single target that uses the gyp variable module_name to set its name (using the &amp;lt;(variable_name) syntax).&amp;nbsp; The target contains the basic and most common defines that are required for each node module and the include dirs that contain the node.h, v8.h and uv.h header files.    &lt;br /&gt;After that, I have added some conditional specification based on the compiling OS. For example, in windows, there is no uint type so I define it in the “defines” section. Moreover, I specify the node.lib file to which the final obj file will link to and I set the output directory using visual studio specific configuration options.     &lt;br /&gt;As for mac users, the linker should include the “-undefined dynamic_lookup” option which is set as a library because ldflags didn’t work as expected (at least for the version of gyp bundled with nodejs). Theoretically I should have specified:    &lt;br /&gt;    &lt;br /&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:fa0e3fdf-ed8a-4e18-bbe1-487e03040185" style="display: inline; float: none; margin: 0px; padding: 0px;"&gt;
&lt;pre style="background-color: white; height: 102px; overflow: auto; width: 660px;"&gt;&lt;div&gt;
&lt;span style="color: maroon;"&gt;'&lt;/span&gt;&lt;span style="color: maroon;"&gt;link_settings&lt;/span&gt;&lt;span style="color: maroon;"&gt;'&lt;/span&gt;&lt;span style="color: black;"&gt;: {
            &lt;/span&gt;&lt;span style="color: maroon;"&gt;'&lt;/span&gt;&lt;span style="color: maroon;"&gt;ldflags&lt;/span&gt;&lt;span style="color: maroon;"&gt;'&lt;/span&gt;&lt;span style="color: black;"&gt;: [
            ‘&lt;/span&gt;&lt;span style="color: black;"&gt;-&lt;/span&gt;&lt;span style="color: black;"&gt;undefined dynamic_lookup’,
        ],
},&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;br/&gt;
but this didn’t work on my tests. Moreover, I didn’t go with xcode to provide the same building instructions for both linux and mac users. &lt;br /&gt;
&lt;h2&gt;
The node-gyp scripts&lt;/h2&gt;
In the provided gyp file (see the end of this post for source code)&amp;nbsp; I am using the NODE_ROOT gyp variable which should point to the root of the nodejs source directory (as discussed in my &lt;a href="http://botsikas.blogspot.com/2011/12/building-native-modules-for-nodejs-06.html" target="_blank"&gt;previous posts&lt;/a&gt;). In order to pass that variable in gyp and in order to simplify the project generation process I have assembled two shell scripts (one for windows and one for linux and mac) in order to use the environment variable NODE_ROOT (using -DNODE_ROOT=%NODE_ROOT% for windows and -DNODE_ROOT=$NODE_ROOT for the rest of the OSs).&amp;nbsp; Especially for windows, the module has to link to node.lib which is generated when you compile node. The “node-gyp.bat” script tries to locate that node.lib and sets the node_lib_folder gyp variable too. &lt;br /&gt;  &lt;br /&gt;Another feature of these scripts is that they try to locate a module.gyp file in case you haven’t specified an argument. I tried to resemble the use of node-waf that locates the wscript. This way, each module can have a module.gyp file in their root directory and the end users may run node-gyp to generate the Makefile or the Visual studio solution.&lt;br /&gt;A final thing to note is that both scripts use the gyp that is bundled with node (in the tools\gyp folder). This version of gyp has an issue that requires you to specify the “--depth=.” option in order to work. This option is used as a bug fix and will be removed in future version of gyp (at least that’s what gyp says).&lt;br /&gt;
&lt;h2&gt;
Source code and script&lt;/h2&gt;
You may download and use the source code and the provided scripts from the following link:&lt;br /&gt;
&lt;iframe title ="Preview" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" width="98px" height="120px" style="padding:0;background-color:#fcfcfc;" src="https://skydrive.live.com/embed?cid=956AC40AD45C58C3&amp;resid=956AC40AD45C58C3%21266&amp;authkey=AGk8bwoicEgQQEo"&gt;&lt;/iframe&gt;
&lt;br /&gt;
Hope this helps!&lt;br /&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-2775009502248866546?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/NYSerTI2U5w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/2775009502248866546/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=2775009502248866546" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/2775009502248866546?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/2775009502248866546?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/NYSerTI2U5w/nodejs-modules-cross-platform.html" title="Node.js modules cross platform compilation using gyp" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/12/nodejs-modules-cross-platform.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UGR3g5eip7ImA9WhRQFko.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-4571915865328194258</id><published>2011-12-09T23:06:00.001+02:00</published><updated>2011-12-12T09:33:46.622+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-12T09:33:46.622+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Node js" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><category scheme="http://www.blogger.com/atom/ns#" term="Node modules" /><category scheme="http://www.blogger.com/atom/ns#" term="dos script" /><title>Building a simple native nodejs module on windows from command line</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div align="justify"&gt;
Setting up a visual studio project to just build a &lt;a href="http://botsikas.blogspot.com/2011/12/building-native-modules-for-nodejs-06.html" target="_blank"&gt;simple native hello world node module&lt;/a&gt; is an overkill and there is a simpler way to do that by using the visual studio command prompt directly. Here you may find the required commands you have to issue, plus a vcbuild.bat file that does the whole thing at once.&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div align="justify"&gt;
The basic idea is that if you fire up a visual studio command line (or execute the command &lt;em&gt;call "%VS100COMNTOOLS%..\..\vc\vcvarsall.bat"&lt;/em&gt; on a regular command line) you get the cl compiler and the link linker tools and you may do the whole module compiling by issuing two commands. Note that VS100COMTOOLS environment variable is set automatically when you install visual studio 2010 (any edition, even the VC++ express one).&lt;/div&gt;
&lt;div align="justify"&gt;
You will need the node source tree (see &lt;a href="http://botsikas.blogspot.com/2011/12/building-native-modules-for-nodejs-06.html" target="_blank"&gt;my previous post on how to do the building&lt;/a&gt; and what are the expected folders and files) in order to get access to the node.lib file where we shall link our obj file. To make it a bit generic, I have created an environment variable named “&lt;strong&gt;&lt;em&gt;NODE_ROOT&lt;/em&gt;&lt;/strong&gt;” to specify the path of node’s source dir. &lt;/div&gt;
&lt;div align="justify"&gt;
Based on this &lt;strong&gt;&lt;em&gt;NODE_ROOT&lt;/em&gt;&lt;/strong&gt; and whether you built node on DEBUG or RELEASE, you may set a temporary environment variable named “&lt;strong&gt;&lt;em&gt;nodelibpath&lt;/em&gt;&lt;/strong&gt;” to either &lt;em&gt;%NODE_ROOT%\Release&lt;/em&gt; or &lt;em&gt;%NODE_ROOT%\Debug&lt;/em&gt; that will pinpoint the location of node.lib.&lt;/div&gt;
&lt;div align="justify"&gt;
Having these variables, you may compile your module issuing:&lt;/div&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:73f91167-1ee7-4a22-b0f7-1e2bf6c57da7" style="display: inline; float: none; margin: 0px; padding: 0px;"&gt;
&lt;pre style="background-color: white; height: 160px; overflow: auto; width: 300px;"&gt;&lt;div&gt;
&lt;span style="color: black;"&gt;@&lt;/span&gt;&lt;span style="color: green;"&gt;rem&lt;/span&gt;&lt;span style="color: green;"&gt; filename "don't strip comments" "no banner" "disable intrinsic functions" "no optimization" "calling conversion __cdecl" "no analysis" "the /I adds some folders in the include path" "no clr. This is deprecated and should be changed but I am working on a gyp file instead of this bat"&lt;/span&gt;&lt;span style="color: green;"&gt;
&lt;/span&gt;&lt;span style="color: black;"&gt;cl&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;exe helloworld&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cpp &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;c &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;nologo &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;Oi- &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;Od &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;Gd &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;analyze- &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;I%NODE_ROOT%&lt;/span&gt;&lt;span style="color: black;"&gt;\&lt;/span&gt;&lt;span style="color: black;"&gt;src&lt;/span&gt;&lt;span style="color: black;"&gt;\&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;I%NODE_ROOT%&lt;/span&gt;&lt;span style="color: black;"&gt;\&lt;/span&gt;&lt;span style="color: black;"&gt;deps&lt;/span&gt;&lt;span style="color: black;"&gt;\&lt;/span&gt;&lt;span style="color: black;"&gt;v8&lt;/span&gt;&lt;span style="color: black;"&gt;\&lt;/span&gt;&lt;span style="color: black;"&gt;include&lt;/span&gt;&lt;span style="color: black;"&gt;\&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;I%NODE_ROOT%&lt;/span&gt;&lt;span style="color: black;"&gt;\&lt;/span&gt;&lt;span style="color: black;"&gt;deps&lt;/span&gt;&lt;span style="color: black;"&gt;\&lt;/span&gt;&lt;span style="color: black;"&gt;uv&lt;/span&gt;&lt;span style="color: black;"&gt;\&lt;/span&gt;&lt;span style="color: black;"&gt;include&lt;/span&gt;&lt;span style="color: black;"&gt;\&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;clr&lt;/span&gt;&lt;span style="color: maroon;"&gt;:noAssembly&lt;/span&gt;&lt;span style="color: black;"&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
and then link it by issuing:&lt;br /&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:8663364c-5448-4306-9fb9-38313d2443f5" style="display: inline; float: none; margin: 0px; padding: 0px;"&gt;
&lt;pre style="background-color: white; height: 80px; overflow: auto; width: 300px;"&gt;&lt;div&gt;
&lt;span style="color: black;"&gt;link helloworld&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;obj node&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;lib &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;OUT:&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;helloworld.dll&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;NOLOGO &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;DLL &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;NOENTRY &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;MANIFEST&lt;/span&gt;&lt;span style="color: maroon;"&gt;:NO&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;TLBID:&lt;/span&gt;&lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;DYNAMICBASE &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;NXCOMPAT &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;MACHINE&lt;/span&gt;&lt;span style="color: maroon;"&gt;:X86&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: blue;"&gt;LIBPATH&lt;/span&gt;&lt;span style="color: black;"&gt;:%nodelibpath%&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
I have created a bat file that assumes that the NODE_ROOT is set (it actually checks to see if it is) and then compiles and links the HelloWorld.cpp module that I used in my earlier post.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You may download the cpp and the bat files from the following link:&lt;/div&gt;
&lt;iframe frameborder="0" height="120" marginheight="0" marginwidth="0" scrolling="no" src="https://skydrive.live.com/embed?cid=956AC40AD45C58C3&amp;amp;resid=956AC40AD45C58C3%21265&amp;amp;authkey=AG-Dg7XZhUCgiDU" style="background-color: #fcfcfc; padding: 0px;" title="Preview" width="98"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-4571915865328194258?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/ZlTEnRniwyM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/4571915865328194258/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=4571915865328194258" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/4571915865328194258?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/4571915865328194258?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/ZlTEnRniwyM/building-simple-native-nodejs-module-on.html" title="Building a simple native nodejs module on windows from command line" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/12/building-simple-native-nodejs-module-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YCR3g7fip7ImA9WhRQFko.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-8034345499429780322</id><published>2011-12-09T21:33:00.001+02:00</published><updated>2011-12-12T09:32:46.606+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-12T09:32:46.606+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Node js" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><category scheme="http://www.blogger.com/atom/ns#" term="Node modules" /><title>Building native modules for nodeJs 0.6+ with visual studio</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div style="text-align: justify;"&gt;
Since version 0.6 node js supports windows native builds which allows the windows dev to use visual studio to build both nodejs and the modules. In order to make a simple node module in visual studio you will have to link the obj file with the node.lib file that is generated when you compile the nodejs on visual studio. Here is a detailed walkthrough on how to successfully build a native node module in visual studio 2010.
&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;h2 style="text-align: justify;"&gt;







Building node (to get the node.lib file)&lt;/h2&gt;
&lt;div style="text-align: justify;"&gt;
First and foremost you have to download the latest code from &lt;a href="https://github.com/joyent/node"&gt;node’s git&lt;/a&gt; (or &lt;a href="http://nodejs.org/#download"&gt;a stable one&lt;/a&gt; if you prefer) and run the vcbuild.bat file that is in the source. This bat will create a visual studio solution and build node using the msbuild tool chain. Watch out that by default this will build a Debug version of node and will fail (at least at the moment) to sign node.exe because it tries to locate node.exe in the Release folder. If you want to do it right (which is not required) you can either edit the vcbuild.bat file or run “vcbuild Release”. Either way, you will end up with a Release or a Debug folder which contains both node.exe and node.lib files. You will need that node.lib to link against it later on.
&lt;/div&gt;
&lt;h2 style="text-align: justify;"&gt;




Writing the Helloworld.cpp&lt;/h2&gt;
&lt;div style="text-align: justify;"&gt;
A lot of blog posts have been written on how to right a simple native Hello World node module so I will mention only the basics here.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li style="text-align: justify;"&gt;Node uses the v8 engine to expose the native methods to javascript. This is why we have to include the v8.h file.&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;Modules usually inherit from the ObjectWrap class and this is why we need the fairly obvious node.h include file.&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;Each module has a constructor and a destructor where you can do your staff there but you must also specify an Init method to initialize the v8 bindings (expose the supported methods etc).&amp;nbsp;&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;Moreover, you will have to create New method which will be called every time you create a new object in javascript.&amp;nbsp;&lt;/li&gt;
&lt;li style="text-align: justify;"&gt;Finally you must not forget to add the extern “C” declaration where you specify the init subroutine (which simply points to your modules init method) and call to NODE_MODULE where you specify the module name and the init method (which is written right above).&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
So here is the HelloWorld.cpp we will be compiling in the following sections:
&lt;/div&gt;
&lt;iframe frameborder="0" height="120" marginheight="0" marginwidth="0" scrolling="no" src="https://skydrive.live.com/embed?cid=956AC40AD45C58C3&amp;amp;resid=956AC40AD45C58C3%21264&amp;amp;authkey=ANhHtN6dAlvRkvM" style="background-color: #fcfcfc; padding: 0px;" title="Preview" width="98"&gt;&lt;/iframe&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style="text-align: justify;"&gt;






Setting up the visual studio project&lt;/h2&gt;
&lt;div style="text-align: justify;"&gt;
Start by creating an empty Visual C++ project.&amp;nbsp;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-krxRT8gcdPo/TuJjx1hWzcI/AAAAAAAAALo/_5fzFABY9ug/s1600/00.CreateEmptyVisualStudio.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="221" src="http://1.bp.blogspot.com/-krxRT8gcdPo/TuJjx1hWzcI/AAAAAAAAALo/_5fzFABY9ug/s320/00.CreateEmptyVisualStudio.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Add the HelloWorld.cpp file you have downloaded from above (don’t expect me to believe that you wrote it) and add it in the Source Files virtual folder. You may optionally add the “node.h” file located in the node’s source directory under the folder src, in the header files to improve your development experience. The project structure should look like the following:&amp;nbsp;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-Ei_bhZCUNw4/TuJj34oRxQI/AAAAAAAAALw/I8n6zG1sODU/s1600/01.ProjectStructure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-Ei_bhZCUNw4/TuJj34oRxQI/AAAAAAAAALw/I8n6zG1sODU/s1600/01.ProjectStructure.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Open the project properties (right click properties on the project) and go to the Configuration Properties→General tab. There you may specify the output directory etc but you must make sure that you select a Dynamic Library (.dll) in the Configuration Type. You may also specify that the target extension is a .node file to avoid renaming the dll output to .node (nodejs requires modules to have a .node extension). My property page look like the following:&amp;nbsp;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-6VnGp6nIZDw/TuJj-ffhl2I/AAAAAAAAAL4/NFnv_PJIpzc/s1600/02.Configuration-General.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="228" src="http://2.bp.blogspot.com/-6VnGp6nIZDw/TuJj-ffhl2I/AAAAAAAAAL4/NFnv_PJIpzc/s320/02.Configuration-General.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Move on to Configuration Properties→VC++ Directories tab. 

Here you will have to add the include directories for node.h, v8.h and uv.h files and the location of the node.lib in the library directories.&amp;nbsp;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-QH5UBxg2a5w/TuJkEwti13I/AAAAAAAAAMA/ldaDdluF6q0/s1600/03.Directories.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="226" src="http://1.bp.blogspot.com/-QH5UBxg2a5w/TuJkEwti13I/AAAAAAAAAMA/ldaDdluF6q0/s320/03.Directories.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
All files are located in the node source tree&amp;nbsp;you have compiled earlier&amp;nbsp;(from now on I will refer to that location as &lt;b&gt;&lt;i&gt;%NODE_ROOT%&lt;/i&gt;&lt;/b&gt;). In the “Include Directories” you must add the following:&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;&lt;i&gt;%NODE_ROOT%&lt;/i&gt;&lt;/b&gt;\src\&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;%NODE_ROOT%&lt;/b&gt;&lt;/i&gt;\deps\v8\include\&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;i&gt;%NODE_ROOT%&lt;/i&gt;&lt;/b&gt;\deps\uv\include\&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
In the “Library Directories” you must add either &lt;b&gt;&lt;i&gt;%NODE_ROOT%&lt;/i&gt;&lt;/b&gt;\Release\ or &lt;b&gt;&lt;i&gt;%NODE_ROOT%&lt;/i&gt;&lt;/b&gt;\Debug\ depending on the exact location of your node.lib file and whether you need the debug symbols that are exposed by node or not.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
There is also an alternative to this step. You may specify the Include Directories in the Configuration Properties→C/C++→General tab under the “Additional Include Directories” field, illustrated bellow:&amp;nbsp;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-z5G3q9HrC3M/TuJkm6vlltI/AAAAAAAAAMI/iBJ95k4DeZ8/s1600/03.Directories_optionb1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="72" src="http://2.bp.blogspot.com/-z5G3q9HrC3M/TuJkm6vlltI/AAAAAAAAAMI/iBJ95k4DeZ8/s320/03.Directories_optionb1.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
As for the Library Directories, you may specify the exact path of the node.lib in the Linker (as show on a later step).&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Based on the reading I did on how to build a native module on nodejs, most of the tutorials mentioned that you should add the “BUILDING_NODE_EXTENSION 1” def into your modules. My personal experience says that this is not requires in node v0.6 but if you want, you may specify this def in the Configuration Properties→C/C++→Preprocessor tab as shown in the next picture:&amp;nbsp;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-2LBoTD9JMgU/TuJkyL3vjvI/AAAAAAAAAMQ/J7jUR01u70E/s1600/04.Preprocessor.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="227" src="http://2.bp.blogspot.com/-2LBoTD9JMgU/TuJkyL3vjvI/AAAAAAAAAMQ/J7jUR01u70E/s320/04.Preprocessor.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The final step is to go to the Configuration Properties→Linker→Input tab where you need to specify the node.lib as an “Additional Dependency”. If you skipped the VC++ Directories setup mentioned above, you should specify the full path to the node.lib file, otherwise a simple node.lib is sufficient:&amp;nbsp;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-dnB5nl-LpIQ/TuJk436dzJI/AAAAAAAAAMY/eu311wWDdQI/s1600/05.Linker_input.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="228" src="http://4.bp.blogspot.com/-dnB5nl-LpIQ/TuJk436dzJI/AAAAAAAAAMY/eu311wWDdQI/s320/05.Linker_input.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
That’s all. You may now build the project and you should see the following output:
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-eJqMo7JFs74/TuJk90ENbfI/AAAAAAAAAMg/IR3xV1ede0g/s1600/06.BuildResult.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="45" src="http://1.bp.blogspot.com/-eJqMo7JFs74/TuJk90ENbfI/AAAAAAAAAMg/IR3xV1ede0g/s320/06.BuildResult.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
If you haven’t set the target extension to .node you will have to manually rename it from .dll to .node and you will be to load the module by posting the require(‘pathtomodule’) command&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Watch out that in my HelloWorld.cpp I expose the Hello function as hello (note the small h) on purpose to demonstrate that it&amp;nbsp;doesn't&amp;nbsp;matter what’s the name of the method in you cpp file, but the name specified in the v8 engine.
You may download a test.js file to test your newly created module here:&amp;nbsp;&lt;/div&gt;
&lt;iframe frameborder="0" height="120" marginheight="0" marginwidth="0" scrolling="no" src="https://skydrive.live.com/embed?cid=956AC40AD45C58C3&amp;amp;resid=956AC40AD45C58C3%21263&amp;amp;authkey=ALQpZqNUhPfw6GQ" style="background-color: #fcfcfc; padding: 0px;" title="Preview" width="98"&gt;&lt;/iframe&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
I hope that this article will give you a heads up on the native windows nodejs module building process! You may also check &lt;a href="http://botsikas.blogspot.com/2011/12/building-simple-native-nodejs-module-on.html"&gt;a simple bat script I have prepared to autocompile the node module&lt;/a&gt;.&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-8034345499429780322?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/Uro2X5Uyqig" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/8034345499429780322/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=8034345499429780322" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/8034345499429780322?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/8034345499429780322?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/Uro2X5Uyqig/building-native-modules-for-nodejs-06.html" title="Building native modules for nodeJs 0.6+ with visual studio" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-krxRT8gcdPo/TuJjx1hWzcI/AAAAAAAAALo/_5fzFABY9ug/s72-c/00.CreateEmptyVisualStudio.png" height="72" width="72" /><thr:total>7</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/12/building-native-modules-for-nodejs-06.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EDR305cCp7ImA9WhRRFUo.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-1741152469907698092</id><published>2011-11-29T17:12:00.001+02:00</published><updated>2011-11-29T17:14:36.328+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-29T17:14:36.328+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Big Blue Button" /><title>Big blue button RSL Error 1 of 4 / Error #2032</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
If you have this kind of problem you can read &lt;a href="http://groups.google.com/group/bigbluebutton-users/browse_thread/thread/4450aaf2c5bfdac6" target="_blank"&gt;this article&lt;/a&gt; or simply:&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
cd /var/www/bigbluebutton/client/&lt;br /&gt;
sudo wget &lt;a href="http://fpdownload.adobe.com/pub/swz/flex/4.5.0.20967/mx_4.5.0.20967.swz"&gt;http://fpdownload.adobe.com/pub/swz/flex/4.5.0.20967/mx_4.5.0.20967.swz&lt;/a&gt;&lt;br /&gt;
sudo wget &lt;a href="http://fpdownload.adobe.com/pub/swz/flex/4.5.0.20967/rpc_4.5.0.20967.swz"&gt;http://fpdownload.adobe.com/pub/swz/flex/4.5.0.20967/rpc_4.5.0.20967.swz&lt;/a&gt;&lt;br /&gt;
sudo wget &lt;a href="http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232.swz"&gt;http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232.swz&lt;/a&gt;&lt;br /&gt;
sudo wget &lt;a href="http://fpdownload.adobe.com/pub/swz/flex/4.5.0.20967/framework_4.5.0.20967.swz"&gt;http://fpdownload.adobe.com/pub/swz/flex/4.5.0.20967/framework_4.5.0.20967.swz&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;This is a problem that may occur when the flash client tries to locate the RSL files (local intranet situations) and by downloading them in the bbb’s folder, the flash can safely failover to that location.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-1741152469907698092?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/SOZOHrVjyuY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/1741152469907698092/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=1741152469907698092" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/1741152469907698092?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/1741152469907698092?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/SOZOHrVjyuY/big-blue-button-rsl-error-1-of-4-error.html" title="Big blue button RSL Error 1 of 4 / Error #2032" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/11/big-blue-button-rsl-error-1-of-4-error.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUEER3k8eyp7ImA9WhdaF04.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-5401553092799849726</id><published>2011-10-15T00:03:00.001+03:00</published><updated>2011-10-27T20:46:46.773+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-27T20:46:46.773+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MySQL" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><title>Create user and db in MySQL for various apps</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div align="justify"&gt;
Working on a portal which requires the integration of various opensource applications, I had to install quite a few systems that require mysql databases. In order to keep a safe separation between these systems, one should create different users that will have access only to the specific database. This is a simple way to prevent losing all your databases in case of&amp;nbsp; the mishap when an attack is successful on a system and sql commands pass directly to the database (sql injection etc). This is a how-to create the new user, the new database and set the requested permissions.&lt;/div&gt;
&lt;div align="justify"&gt;
&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div align="justify"&gt;
Open up a console (if you are not already on a terminal) and login to you mysql environment by posting the following command:&lt;/div&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:ce8c285a-8ca1-4c8c-83a0-b73f8afeb9f9" style="display: inline; float: none; margin: 0px; padding: 0px;"&gt;
&lt;pre style="background-color: white;"&gt;&lt;div&gt;
&lt;span style="color: black;"&gt;mysql &lt;/span&gt;&lt;span style="color: black;"&gt;-&lt;/span&gt;&lt;span style="color: black;"&gt;uROOT_USERNAME &lt;/span&gt;&lt;span style="color: black;"&gt;-&lt;/span&gt;&lt;span style="color: black;"&gt;p&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
where ROOT_USERNAME is a user that has create user and db permission (usually you will be using the ‘root’ user). This command will prompt you for the user password and after that you will get the mysql prompt:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:ea025e86-b5b7-454e-b725-166de1daf609" style="display: inline; float: none; margin: 0px; padding: 0px;"&gt;
&lt;pre style="background-color: white;"&gt;&lt;div&gt;
&lt;span style="color: black;"&gt;mysql&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
In this command prompt you will have to create a new user (with username ‘new_username’) that will be able to login using ‘new_user_password’ as password. Check out that this user is on the ‘localhost’ domain which is fine since it is a good practice to not allow connection directly to the database from outer sources. To create this user, you will have to post the following command:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:87af45eb-528c-462e-becd-266a77ef761c" style="display: inline; float: none; margin: 0px; padding: 0px;"&gt;
&lt;pre style="background-color: white;"&gt;&lt;div&gt;
&lt;span style="color: black;"&gt;create user ‘new_username’&lt;/span&gt;&lt;span style="color: black;"&gt;@&lt;/span&gt;&lt;span style="color: black;"&gt;'localhost' IDENTIFIED by 'new_user_password';&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
The next step is to create a new database named “new_database_name”:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:9fcd08d6-f0e9-4657-a03a-e6329ebb42c1" style="display: inline; float: none; margin: 0px; padding: 0px;"&gt;
&lt;pre style="background-color: white;"&gt;&lt;div&gt;
&lt;span style="color: black;"&gt;create database new_database_name;&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
The final step is to set the required permissions in order to allow the user to operate on the database and create the schema. The most common set of permissions that is given to equivalent users (based on the drupal setup instructions) is the following:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:abd22c56-e4e1-423f-9052-df6cbd53574f" style="display: inline; float: none; margin: 0px; padding: 0px;"&gt;
&lt;pre style="background-color: white;"&gt;&lt;div&gt;
&lt;span style="color: black;"&gt;GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON new_database_name.&lt;/span&gt;&lt;span style="color: black;"&gt;*&lt;/span&gt;&lt;span style="color: black;"&gt; to 'new_username'&lt;/span&gt;&lt;span style="color: black;"&gt;@&lt;/span&gt;&lt;span style="color: black;"&gt;'localhost' identified by 'new_user_password';&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
In order to enable all the permissions you will also have to flush the privileges on the MySQL server by posting:&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:46ec76b6-2d35-47d1-b763-cd98bbcf56e0" style="display: inline; float: none; margin: 0px; padding: 0px;"&gt;
&lt;pre style="background-color: white;"&gt;&lt;div&gt;
&lt;span style="color: black;"&gt;flush privileges;&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
After that you may exit the mysql prompt by posting the “quit” command. Don’t forget the ending semi columns on all the above mentioned commands because otherwise you will be getting a prompt to continue your command when you press enter.&lt;br /&gt;
&lt;br /&gt;
That’s all folks. From this point on you may continue with your system installation providing the newly created credentials.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-5401553092799849726?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/22pqu1CxWQA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/5401553092799849726/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=5401553092799849726" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/5401553092799849726?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/5401553092799849726?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/22pqu1CxWQA/create-user-and-db-in-mysql-for-various.html" title="Create user and db in MySQL for various apps" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/10/create-user-and-db-in-mysql-for-various.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUMQHg4fSp7ImA9WhdbFk8.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-6909995547196772813</id><published>2011-09-28T22:07:00.001+03:00</published><updated>2011-10-15T00:04:41.635+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-15T00:04:41.635+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MySQL" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><category scheme="http://www.blogger.com/atom/ns#" term="reset password" /><title>Reset mysql 5.1 root pass</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I had to install a couple of dbs on a mysql server which refused to recognize me as its root… I kept receiving the following not-so-friendly message:&lt;br /&gt;
&lt;blockquote&gt;
&lt;em&gt;ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)&lt;/em&gt;&lt;/blockquote&gt;
As it turns out, something was messed up during the installation and mysql did not recognize the given root password (mistype perhaps?). Anyway, I had to reset the pass, and this is how I did it.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Stop the service:&lt;br /&gt;
&lt;blockquote&gt;
&lt;em&gt;sudo service mysql stop&lt;/em&gt;&lt;/blockquote&gt;
Start on safe mode without permissions check:&lt;br /&gt;
&lt;blockquote&gt;
&lt;em&gt;sudo mysqld_safe --skip-grant-tables &amp;amp;&lt;/em&gt;&lt;/blockquote&gt;
Login as root on mysql:&lt;br /&gt;
&lt;blockquote&gt;
&lt;em&gt;mysql -u root&lt;/em&gt; &lt;/blockquote&gt;
Update the root user’s password in the corresponding table:&lt;br /&gt;
&lt;blockquote&gt;
&lt;em&gt;mysql&amp;gt; use mysql;       &lt;br /&gt;mysql&amp;gt; update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';        &lt;br /&gt;mysql&amp;gt; flush privileges;        &lt;br /&gt;mysql&amp;gt; quit&lt;/em&gt;&lt;/blockquote&gt;
And then restart the mysql service... &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-6909995547196772813?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/FM5HSl3vhHc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/6909995547196772813/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=6909995547196772813" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/6909995547196772813?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/6909995547196772813?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/FM5HSl3vhHc/reset-mysql-51-root-pass.html" title="Reset mysql 5.1 root pass" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/09/reset-mysql-51-root-pass.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cBRH4yeSp7ImA9WhdUEkw.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-3435039421551392235</id><published>2011-09-28T16:03:00.000+03:00</published><updated>2011-09-28T16:04:15.091+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-28T16:04:15.091+03:00</app:edited><title>Install bigbluebutton 0.8 (BBB) on Ubuntu 11.04</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I recently installed &lt;a href="http://code.google.com/p/bigbluebutton/wiki/08InstallationUbuntu" target="_blank"&gt;big blue button version 0.8&lt;/a&gt; on Ubuntu 11.04 and I came up with some errors while installing. This post is the log of my actions that solved my problem.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
I was getting the following error:&lt;br /&gt;
&lt;em&gt;&lt;blockquote&gt;
Unpacking bbb-client (from .../bbb-client_0.80ubuntu91_amd64.deb) ...     &lt;br /&gt;
cp: cannot stat `/var/www/nginx-default/50x.html': No such file or directory      &lt;br /&gt;
dpkg: error processing /var/cache/apt/archives/bbb-client_0.80ubuntu91_amd64.deb (--unpack):      &lt;br /&gt;
subprocess new pre-installation script returned error exit status 1      &lt;br /&gt;
Errors were encountered while processing:      &lt;br /&gt;
/var/cache/apt/archives/bbb-client_0.80ubuntu91_amd64.deb      &lt;br /&gt;
E: Sub-process /usr/bin/dpkg returned an error code (1)&lt;/blockquote&gt;
&lt;/em&gt;The problem was that nginx didn’t create the web root folder in /var/www/ so I made a softlink by giving the following command:&lt;em&gt;&lt;blockquote&gt;
var/www$ sudo ln -s -d /usr/share/nginx/www/ nginx-default&lt;/blockquote&gt;
&lt;/em&gt;Then I got the following error:&lt;em&gt;&lt;blockquote&gt;
Setting up bbb-record-core (0.80ubuntu87) ...&lt;br /&gt;
/etc/init.d/bbb-record-core: line 24: god: command not found     &lt;br /&gt;
invoke-rc.d: initscript bbb-record-core, action "start" failed.      &lt;br /&gt;
dpkg: error processing bbb-record-core (--configure):      &lt;br /&gt;
subprocess installed post-installation script returned error exit status 127      &lt;br /&gt;
Errors were encountered while processing:      &lt;br /&gt;
bbb-record-core      &lt;br /&gt;
E: Sub-process /usr/bin/dpkg returned an error code (1)&lt;/blockquote&gt;
&lt;/em&gt;which seemed to be as easy as to link the ruby’s god exe in the local bin by posting the following command:&lt;em&gt;&lt;blockquote&gt;
sudo ln -s /var/lib/gems/1.8/bin/god /usr/local/bin&lt;/blockquote&gt;
&lt;/em&gt;but unfortunately this gave me the following error:&lt;em&gt;&lt;blockquote&gt;
Setting up bbb-record-core (0.80ubuntu87) ...&lt;br /&gt;
Record and Playback monitoring started     &lt;br /&gt;
sudo: bundle: command not found      &lt;br /&gt;
dpkg: error processing bbb-record-core (--configure):      &lt;br /&gt;
subprocess installed post-installation script returned error exit status 1      &lt;br /&gt;
Errors were encountered while processing:      &lt;br /&gt;
bbb-record-core      &lt;br /&gt;
E: Sub-process /usr/bin/dpkg returned an error code (1)&lt;/blockquote&gt;
&lt;/em&gt;
which indicated that bbb also required the bundle gem. Fixed that also by posting the equivalent cmd:
&lt;em&gt;&lt;blockquote&gt;
sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin     &lt;/blockquote&gt;
&lt;/em&gt;And finally big blue button installed on my server… The last two links could be avoided if I had installed the RVM manager (or so it seems) but I didn’t have the time or the will to do so. If you want to get your hands into it, check out &lt;a href="http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/" target="_blank"&gt;this blog post which seemed like a nice guide on installing ruby on ubuntu&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-3435039421551392235?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/ocoQnzeO-vo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/3435039421551392235/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=3435039421551392235" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/3435039421551392235?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/3435039421551392235?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/ocoQnzeO-vo/install-bigbluebutton-08-bbb-on-ubuntu.html" title="Install bigbluebutton 0.8 (BBB) on Ubuntu 11.04" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/09/install-bigbluebutton-08-bbb-on-ubuntu.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EASXg7eyp7ImA9WhdVGEw.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-799086597727736248</id><published>2011-09-24T00:59:00.001+03:00</published><updated>2011-09-24T01:07:28.603+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-24T01:07:28.603+03:00</app:edited><title>Word to CHM source code</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I have just finished updating an old buggy sourceforge project and decided to share code and binaries. More over, I have written a nice post on why I had to update the project and how to use it to convert word to mobi files for kindle&amp;nbsp;but thanks to Windows Live Writer (which crashed :-( ) I lost it all!&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;




Summary of previous (lost) post&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Kindle (up to 3) doesn’t support word&lt;/li&gt;
&lt;li&gt;I use &lt;a href="http://calibre-ebook.com/" target="_blank"&gt;calibre&lt;/a&gt; for file conversions (and ebook management) &lt;/li&gt;
&lt;li&gt;word—&amp;gt; pdf—&amp;gt; mobi process is no good for technical reports with lots of images and diagrams (most of the pictures are displayed at random places)&lt;/li&gt;
&lt;li&gt;word –&amp;gt; rft –&amp;gt;mobi is better but will not work on large files&lt;/li&gt;
&lt;li&gt;word –&amp;gt;chm –&amp;gt;mobi&amp;nbsp; pretty good results&lt;/li&gt;
&lt;li&gt;The old project converted doc to html via office interops, cleared the html using HTMLTidy interop and saved a xhtml. The output was fed to Microsoft Help Compiler and voila the chm file.&lt;/li&gt;
&lt;li&gt;The &lt;a href="http://sourceforge.net/projects/msword2chm/" target="_blank"&gt;old project&lt;/a&gt; was buggy on a x64 platform (probably the dev had a x86 machine, used x86 interops, and forgot to change the compiler option from “AnyCPU” to x86)&lt;/li&gt;
&lt;li&gt;The old project had an old HTMLTidy reference which I replace for the newer &lt;a href="https://github.com/markbeaton/TidyManaged" target="_blank"&gt;TidyManaged&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
&lt;iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="https://skydrive.live.com/embedicon.aspx/StudentGuruStaff/WordToCHM.src.zip?cid=956ac40ad45c58c3&amp;amp;sc=documents" style="background-color: #fcfcfc; height: 115px; padding: 0px; width: 98px;" title="Preview"&gt;&lt;/iframe&gt;  &lt;br /&gt;
&lt;br /&gt;
Binaries:&lt;br /&gt;
&lt;iframe title ="Preview" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:98px;height:115px;padding:0;background-color:#fcfcfc;" src="https://skydrive.live.com/embedicon.aspx/StudentGuruStaff/WordToCHM.bin.zip?cid=956ac40ad45c58c3&amp;sc=documents"&gt;&lt;/iframe&gt;  &lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-799086597727736248?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/dgGUqSsyU9o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/799086597727736248/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=799086597727736248" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/799086597727736248?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/799086597727736248?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/dgGUqSsyU9o/word-to-chm.html" title="Word to CHM source code" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/09/word-to-chm.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMGQXc7fyp7ImA9WhdXFkw.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-7927710952337309932</id><published>2011-06-10T09:44:00.025+03:00</published><updated>2011-08-29T14:47:00.907+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-29T14:47:00.907+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="IIS" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><title>Securing Asp.net applications by hidding response header</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Although it’s fairly obvious that a website is running asp.net (through session cookie and the viewstate) you may protect your server by removing a few response headers that advertise the iis and the asp.net version. The most common response headers you should remove are the following:&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;X-Powered-By:ASP.NET&lt;/li&gt;
&lt;li&gt;X-AspNet-Version:*.*.*&lt;/li&gt;
&lt;li&gt;Server:Microsoft-IIS/*.*&lt;/li&gt;
&lt;/ul&gt;
&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;The X-Powered-By response header&lt;/span&gt;&lt;br /&gt;
This header is added by the iis and you may remove it via the “Http Response Headers” in the iis configuration tool as shown in the following images for iis 7+:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-4iGzr6CrPrA/TfG9pucBniI/AAAAAAAAAI4/9KUn05NiJJU/s1600/HttpResponseHeaders.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://4.bp.blogspot.com/-4iGzr6CrPrA/TfG9pucBniI/AAAAAAAAAI4/9KUn05NiJJU/s320/HttpResponseHeaders.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-C-ojMcvc1lI/TfG9qC429MI/AAAAAAAAAI8/ty0PbvIBjzU/s1600/HttpResponseHeadersStep2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="102" src="http://3.bp.blogspot.com/-C-ojMcvc1lI/TfG9qC429MI/AAAAAAAAAI8/ty0PbvIBjzU/s320/HttpResponseHeadersStep2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
and for iis 6 you should check the following image:&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-3yUroqDKzD4/TfG9qmvBaqI/AAAAAAAAAJA/kLf-RodkZ8s/s1600/HttpResponseHeadersStep2IIS6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="312" src="http://1.bp.blogspot.com/-3yUroqDKzD4/TfG9qmvBaqI/AAAAAAAAAJA/kLf-RodkZ8s/s320/HttpResponseHeadersStep2IIS6.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
The X-AspNet-Version response header&lt;/h3&gt;
This is advertised by the .net framework. You may remove this by adding the following entry in your application’s web.config file:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-iJGPq1wXP2o/TfHR6E8dbmI/AAAAAAAAAJI/fbGmtr8UglU/s1600/enableVersionHeader.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="51" src="http://3.bp.blogspot.com/-iJGPq1wXP2o/TfHR6E8dbmI/AAAAAAAAAJI/fbGmtr8UglU/s320/enableVersionHeader.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
httpRuntime is located at configuration\system.web&lt;br /&gt;
In the case of the MVC, you should also consider disabling the MvcResponseHeader setting the value of System.Web.Mvc.MvcHandler.DisableMvcResponseHeader to true in the gloabal.asax file when the application starts.&lt;br /&gt;
&lt;h3&gt;
The Server response header&lt;/h3&gt;
The hardest response header to remove is the Server one. Quoting the tip from &lt;a href="http://serverfault.com/questions/24885/how-to-remove-iis-asp-net-response-headers"&gt;serverfault.com&lt;/a&gt;:&lt;br /&gt;
&lt;blockquote&gt;
For the Server header, on IIS6 you can use Microsoft's &lt;a href="http://learn.iis.net/page.aspx/726/urlscan-overview/"&gt;URLScan &lt;/a&gt;tool to remote that. For IIS7, there is a &lt;a href="http://blogs.technet.com/stefan_gossner/archive/2008/03/12/iis-7-how-to-send-a-custom-server-http-header.aspx"&gt;great article&lt;/a&gt; on using a custom module to modify the Server header.&lt;/blockquote&gt;
URLScan tool is easy to install. Don’t forget to enable it by adding it in the ISAPI Filters (the dll is usually located at %windir%\system32\inetsrv\urlscan\urlscan.dll).&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-guy_7lq1k2k/TfHRO-Qy9PI/AAAAAAAAAJE/mPqSDuSDoa4/s1600/UrlScan.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="218" src="http://3.bp.blogspot.com/-guy_7lq1k2k/TfHRO-Qy9PI/AAAAAAAAAJE/mPqSDuSDoa4/s320/UrlScan.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
You should also make sure that you enable the RemoveServerHeader option in the UrlScan.ini file that is located next to the dll file by setting this options value to 1.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-7927710952337309932?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/KrNTLyiwVuk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/7927710952337309932/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=7927710952337309932" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/7927710952337309932?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/7927710952337309932?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/KrNTLyiwVuk/securing-aspnet-applications-by-hidding.html" title="Securing Asp.net applications by hidding response header" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-4iGzr6CrPrA/TfG9pucBniI/AAAAAAAAAI4/9KUn05NiJJU/s72-c/HttpResponseHeaders.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/06/securing-aspnet-applications-by-hidding.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8AQXs4fSp7ImA9Wx9bGE4.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-727824595565295711</id><published>2011-02-27T20:13:00.003+02:00</published><updated>2011-02-27T20:20:40.535+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-27T20:20:40.535+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SilverLight" /><title>Silverlight 1.1 Alpha Refresh patch to run after expiration date</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Once upon a time I won a Silverlight coding competition by writing a simple game in Silverlight 1.1 Alpha Refresh. A few weeks ago a beta tester of my game requested to play with it, once more. Installing the redistributable (thanks god I keep an archive of these because I couldn’t find it on Microsoft’s site) I came up with a message box that said that this version has expired (the alpha version should expire on 1st nov 2007). &lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Thus, I tried the version 2.0 redistributable. To my disappointment, the Silverlight 2.0 that was released after the Silverlight 1.1 Alpha didn’t support the code I had written and I had to modify a couple of things to make it run under version 2.0. &lt;br /&gt;
In order to avoid editing the code I tried to “extend” the alpha expiration date. So I ended up installing a trial of IDA Pro 6 and checking the assembly of the “C:\Program Files\Microsoft Silverlight\npctrl.1.0.20816.0.dll” file. If you open up the file in a hex editor and go to the 00014EE5 address you will see the following hex values:&lt;br /&gt;
&lt;div style="text-align: center;"&gt;66 3D D8 07 &lt;/div&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt;66 3D is the CMP EAX operand. EAX contains the year (pushed there in the previous lines) and &lt;/li&gt;
&lt;li&gt;D8 07 represents the hex number 7D8 which is 2008.&lt;/li&gt;
&lt;/ol&gt;After that, there is the JBE (0F 86,&lt;a href="http://faydoc.tripod.com/cpu/jbe.htm"&gt;Jump short if below or equal&lt;/a&gt;) operand that leads to the nasty message box. &lt;br /&gt;
&lt;br /&gt;
Thus, there are two ways to achieve the desired “extension”. Either change D8 07 to 34 08 (which will lead to an expiration in the year 2101, when I will be long gone) or change the JBE to JG (0F 8F, Jump short if greater) which will allow the alpha version to run only if the year is greater than 2008. &lt;br /&gt;
Just in case you are too lazy to open the file in a hex editor, I have packed both the redistributable and the patched dll in a zip file which you can download from here:&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://cid-956ac40ad45c58c3.photos.live.com/embedicon.aspx/StudentGuruStaff/SilverLight1.1AlphaRefresh.zip" style="background-color: #fcfcfc; height: 115px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 98px;" title="Preview"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-727824595565295711?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/IKpUTV1nxzg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/727824595565295711/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=727824595565295711" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/727824595565295711?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/727824595565295711?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/IKpUTV1nxzg/silverlight-11-alpha-refresh-patch-to.html" title="Silverlight 1.1 Alpha Refresh patch to run after expiration date" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/02/silverlight-11-alpha-refresh-patch-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UARnY_eyp7ImA9Wx9WE04.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-6568073054622991837</id><published>2011-01-18T09:20:00.001+02:00</published><updated>2011-01-18T09:20:47.843+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-18T09:20:47.843+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Authentication" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows Sharepoint Services 3.0" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><title>Integrating WSS 3.0 Document Library into an existing asp.net application. Setting up the authentication.</title><content type="html">&lt;p&gt;If you search around the net, you’ll most probably find a lot of articles discussing how to create windows sharepoint services (WSS) modules or even how to install WSS on top of existing web site. In my case, I have to create a document management system in an existing asp.net application. In order to do so, I will be using the office integration that is provided by the document library of WSS and will be writing custom forms to handle the rest of the gui. &lt;/p&gt;  &lt;a name='more'&gt;&lt;/a&gt;  &lt;p&gt;My asp.net application uses a customasp.net membership provider in order to authenticate users. So, my first idea was to enable Form Based Authentication (FBA) on WSS and setup the custom membership provider to handle the requests. Well, although this worked concerning the security aspects of the integration, the user had to login once more in WSS whenever he was requesting something from sharepoint and moreover, the office integration of the document library &lt;a href="http://www.sharepointdev.net/sharepoint--setup-upgrade-administration-operation/client-integration-tools-not-working-properly-in-fba-4328.shtml" target="_blank"&gt;didn’t work well&lt;/a&gt;. To be more precise, whenever the user requested a document from the sharepoint server, word fired up and tried to open the specified document. The problem is that word doesn’t have the browser’s authentication cookie, thus the resource is out of reach and sharepoint redirected to the login screen. Having searched the net, I found that there was an &lt;a href="http://msdn.microsoft.com/en-us/library/bb977430(v=office.12).aspx#MOSSFBAPart3_IntegratingWithOffice2007" target="_blank"&gt;update for office 2007&lt;/a&gt; that would make office FBA agnostic but my clients had older versions of office and I couldn’t find anything for them. Moreover, I have office 2010 which would load the authentication form and display it to me as the requested document. &lt;/p&gt;  &lt;p&gt;So I had to solve two problems; single sign in for both my asp.net application and the sharepoint services, and make office integration work with any version of office. The first problem can be easily solved if you create an encrypted authentication cookie that is available to both the asp.net application and WSS. The second problem can be solved if you make that cookie persistent, thus making it available to the whole system and not just the browser that made the authentication request. &lt;/p&gt;  &lt;p&gt;I have already posted another blog post on how to enable &lt;a href="http://botsikas.blogspot.com/2011/01/configuring-forms-authentication-across.html" target="_blank"&gt;forms authentication sharing across asp.net applications&lt;/a&gt; which partially solves the first problem. In the case of WSS you’ll have to note a few things.&lt;/p&gt;  &lt;p&gt;First and foremost, the default configuration in the WSS site (defined in the web.config that usually resides in C:\Inetpub\wwwroot\wss\VirtualDirectories\&amp;lt;PortNumber&amp;gt;\) sets both the validationKey and decryptionKey to something like the following:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;machineKey&lt;/span&gt; &lt;span style="color: #ff0000"&gt;validationKey&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;C50B3C89CB21F4F1422FF158A5B42D0E8DB8CB5CDA1742572A487D9401E3400267682B202B746511891C1BAF47F8D25C07F6C39A104696DB51F17C529AD3CABE&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;decryptionKey&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;8A9BE8FD67AF6979E7D20198CFEA50DD3D3799C77AF2B72F&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;validation&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;SHA1&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In that case you’ll have to copy this line and add it in your asp.net application’ web.config. That way, both applications will be able to verify the validity of the generated authentication cookie.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You’ll also have to set the timeout property of the configuration\system.web\authentication\forms node in the web.config to something high enough (30 or even more) in order to avoid any cookie expiration while working on an office document. If the cookie expires, the user will not be able to save his work and you’ll end up receiving technical support calls… Be advised that you’ll have to set the same timeout on all asp.net applications because otherwise the cookie is expected to expire in the shortest timeout specified among the asp.net applications.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Another thing we’ll have to take care of is the authentication process on sharepoint services. We shall not use the build in authentication form. Rather than that, we will be implementing a custom authentication HttpModule which will be redirecting any unauthenticated request to the asp.net application that we already have. In order to see how this is done, you may check my other blog post named “&lt;a href="http://botsikas.blogspot.com/2011/01/redirecting-any-unauthenticated.html" target="_blank"&gt;redirecting any unauthenticated requests to a login form located on another asp.net application&lt;/a&gt;”.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;One final thing to do is to setup the same membership provider on both the asp.net website that will be authenticating the requests and the windows sharepoint services. As for the WSS, you should probably configure both the website and the management website (installed by default in port 2562) if you would like to manage the permission on the document library through the management site. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Hope this article helps a bit…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-6568073054622991837?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/KhtR_IS3mhk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/6568073054622991837/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=6568073054622991837" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/6568073054622991837?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/6568073054622991837?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/KhtR_IS3mhk/integrating-wss-30-document-library.html" title="Integrating WSS 3.0 Document Library into an existing asp.net application. Setting up the authentication." /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/01/integrating-wss-30-document-library.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEARH4_eip7ImA9Wx9WEkg.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-3317448900765417326</id><published>2011-01-17T11:30:00.001+02:00</published><updated>2011-01-17T11:30:45.042+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-17T11:30:45.042+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Authentication" /><category scheme="http://www.blogger.com/atom/ns#" term="Custom Configuration Section" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><title>Redirecting any unauthenticated requests to a login form located on another asp.net application</title><content type="html">&lt;p&gt;If you have configured &lt;a href="http://botsikas.blogspot.com/2011/01/configuring-forms-authentication-across.html" target="_blank"&gt;forms authentication across multiple asp.net applications&lt;/a&gt;, you may want to force users to authenticate in a single signing form. To do so you may implement a simple HttpModule that will be handling the AuthenticateRequest and redirecting to the corresponding login form. &lt;/p&gt;  &lt;a name='more'&gt;&lt;/a&gt;  &lt;h2&gt;Custom configuration section&lt;/h2&gt;  &lt;p&gt;We shall create a configuration section in order to save the login form url. The configuration section in the web.config should look like the following:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;RedirectToLoginConfiguration&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;loginForm&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;http://authenticationServer/login.aspx&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;RedirectToLoginConfiguration&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To do so, we will write two classes; one inheriting from ConfigurationSection and another inheriting from ConfigurationElement. The code for those two classes is self-explaining (I hope):&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// &amp;lt;summary&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// This is the class that represents the web.config section for the RedirectToLogin module &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// The following is a valid configuration section: &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// &amp;lt;RedirectToLoginConfiguration&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// &amp;lt;loginForm url=&amp;quot;http://authenticationServer/login.aspx&amp;quot;/&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// &amp;lt;/RedirectToLoginConfiguration&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// Notes: The name of the section is declared inside the web.config under the configSections element. &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// In the above example, I have named my section RedirectToLoginConfiguration. &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// &amp;lt;/summary&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;class&lt;/span&gt; RedirectToLoginConfigurationSection: ConfigurationSection &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{ &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  [ConfigurationProperty(&amp;quot;&lt;span style="color: #8b0000"&gt;loginForm&lt;/span&gt;&amp;quot;, IsRequired = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)] &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; LoginFormElement LoginForm { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (LoginFormElement)&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;[&amp;quot;&lt;span style="color: #8b0000"&gt;loginForm&lt;/span&gt;&amp;quot;]; } } &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// &amp;lt;summary&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// This class will keep any configuration info needed by the RedirectToLogin module regarding the &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// login form. &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #808080"&gt;/// &amp;lt;/summary&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;class&lt;/span&gt; LoginFormElement: ConfigurationElement &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{ &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  [ConfigurationProperty(&amp;quot;&lt;span style="color: #8b0000"&gt;url&lt;/span&gt;&amp;quot;,IsRequired=&lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)] &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Url { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;[&amp;quot;&lt;span style="color: #8b0000"&gt;url&lt;/span&gt;&amp;quot;]; } }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;} &lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The IHttpModule&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The module will implement the IHttpModule interface and will hook up on the HttpApplication’s AuthenticateRequest event. &lt;br /&gt;  &lt;br /&gt;Whenever the request is not authenticated (HttpContext.Current.Request.IsAuthenticated) we will be redirecting to the specified login form url adding the ReturnUrl querystring parameter in order to have the user redirected to the current path when he provides valid credentials. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You may download the commented source code for this module and its configuration classes from the following link:&lt;/p&gt;&lt;br /&gt;&lt;iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="http://cid-956ac40ad45c58c3.photos.live.com/embedicon.aspx/StudentGuruStaff/RedirectToLoginModule.cs" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Note that I have used the #if DEBUG declaration in order to provide logging when the dll is built in debug configuration. The logging mechanism is really simple and is not recommended (I could even characterize it as a very bad practice). If you want to implement robust logging, check out &lt;a href="http://weblogs.asp.net/scottgu/archive/2006/05/08/Two-Nice-ASP.NET-Tracing-and-Logging-Articles.aspx"&gt;this ScottGu’s blogpost&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Setting up the asp.net applications&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You must have at least an asp.net application with a login form that will be handling the authentication. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In the rest of the asp.net applications, in the web.config file you’ll have to setup the configuration section by adding the following line in the configuration\configSections section:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;section&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;RedirectToLoginConfiguration&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Abot.Security.RedirectToLoginConfigurationSection,Abot.Security, Version=1.0.0.0, Culture=neutral, PublicKeyToken=69e32cb50fe06fd0&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;And then by adding the configured section under the configuration node:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;RedirectToLoginConfiguration&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;loginForm&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;http://authenticationServer/login.aspx&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;RedirectToLoginConfiguration&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Finally, you should enable the Http module by adding the following line in the system.web\ httpModules section:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;RedirectToLoginScreen&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Abot.Security.RedirectToLogin,Abot.Security, Version=1.0.0.0, Culture=neutral, PublicKeyToken=69e32cb50fe06fd0&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-3317448900765417326?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/pkmSkYSqYho" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/3317448900765417326/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=3317448900765417326" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/3317448900765417326?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/3317448900765417326?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/pkmSkYSqYho/redirecting-any-unauthenticated.html" title="Redirecting any unauthenticated requests to a login form located on another asp.net application" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/01/redirecting-any-unauthenticated.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cASH09fip7ImA9Wx9WEkg.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-5307150467005299301</id><published>2011-01-17T11:03:00.001+02:00</published><updated>2011-01-17T11:04:09.366+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-17T11:04:09.366+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Authentication" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><title>Configuring forms authentication across asp.net applications</title><content type="html">&lt;p align="justify"&gt;In order to enable forms authentication across multiple asp.net application you will have to setup the forms authentication to specify the same name, protection and path among all the asp.net applications that will be collaborating. &lt;/p&gt;  &lt;a name='more'&gt;&lt;/a&gt;  &lt;p align="justify"&gt;The following is an example of the configuration\system.web\authentication node in the web.config of each asp.net application.   &lt;br /&gt;&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;authentication&lt;/span&gt; &lt;span style="color: #ff0000"&gt;mode&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Forms&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;forms&lt;/span&gt; &lt;span style="color: #ff0000"&gt;loginUrl&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;login.aspx&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;.ASPXFORMSAUTH&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;protection&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;All&amp;quot;&lt;/span&gt;  &lt;br /&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #ff0000"&gt;path&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;/&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;timeout&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;30&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;authentication&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;pre&gt;Moreover, you will have to modify the &lt;a href="http://msdn.microsoft.com/en-us/library/ff649308.aspx" target="_blank"&gt;MachineKey&lt;/a&gt; in the web.config (under the section configuration\system.web) of each application and remove the IsolateApps that is declared in the default machine.config.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;pre&gt;If your applications are located on the same server or farm, then you may leave validationKey=&amp;quot;AutoGenerate&amp;quot; and decryptionKey=&amp;quot;AutoGenerate&amp;quot;. Otherwise, you will have to specify a common validationKey and decryptionKey that will be shared among the asp.net applications. This way, each and every asp.net application will be able to validate the authentication cookie set during the authentication process.&lt;br /&gt;One final thing to have in mind is that you’ll have to setup the same membership provider on all your asp.net applications in order to have access to the same users.&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;  &lt;pre&gt;&lt;br /&gt;There is a very good article named &lt;a href="http://msdn.microsoft.com/en-us/library/eb0zx8fc.aspx" target="_blank"&gt;“Configuring Forms Authentication Across Applications”&amp;#160; in msdn&lt;/a&gt; where you can see a full config example.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-5307150467005299301?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/EaNPEjANeLo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/5307150467005299301/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=5307150467005299301" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/5307150467005299301?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/5307150467005299301?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/EaNPEjANeLo/configuring-forms-authentication-across.html" title="Configuring forms authentication across asp.net applications" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/01/configuring-forms-authentication-across.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YDQH4zeSp7ImA9Wx9WEkg.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-488796763157177531</id><published>2011-01-13T13:19:00.005+02:00</published><updated>2011-01-17T11:06:11.081+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-17T11:06:11.081+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Authentication" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><category scheme="http://www.blogger.com/atom/ns#" term="IHttpModule" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><title>Asp.net HTTP module to force authenticate user via Basic WWW-Authenticate dialogue</title><content type="html">Playing around with the available authentication methods I came up with a simple Http module that forces the browser to display the build in credentials form and authenticates the user by simply adding a line in the web.config file.  &lt;br /&gt;  &lt;a name='more'&gt;&lt;/a&gt;  &lt;br /&gt;This is actually a pretty simple class that inherits the IHttpModule interface and hooks up on the web application’s Authenticate request event in order to modify the response headers and reply with a 401 error code.   &lt;br /&gt;In order to dictate the browser in showing the build in login form, you’ll have to add the WWW-Authenticate header on the first unauthenticated call.  &lt;br /&gt;  &lt;table style="text-align: center; margin-left: auto; margin-right: auto" class="tr-caption-container" cellspacing="0" cellpadding="0" align="center"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td style="text-align: center"&gt;&lt;a style="margin-left: auto; margin-right: auto" href="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/TS7hJgqwOkI/AAAAAAAAAIw/xO63M26gnNg/s1600/IEDefaultLoginForm.jpg" imageanchor="1"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/TS7hJgqwOkI/AAAAAAAAAIw/xO63M26gnNg/s200/IEDefaultLoginForm.jpg" width="200" height="172" n4="true" /&gt;&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td style="text-align: center" class="tr-caption"&gt;IE default &amp;quot;request for credentials&amp;quot; dialogue&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt; When the user provides the requested credentials, the module parses the new request and tries to locate the “Authorization” header that should contain a value like the following:  &lt;br /&gt;  &lt;br /&gt;  &lt;div style="text-align: center"&gt;Basic aGVsbG86bGw=&lt;/div&gt;  &lt;br /&gt;This string contains the username and the password in a username:password format that is provided in a Base64 encoding. To be more specific, aGVsbG86bGw= is the Base64 encoding of the UTF7 string “hello:ll” which means that the username is hello and the password is ll.   &lt;br /&gt;  &lt;blockquote&gt;As you may understand there is a &lt;strong&gt;MAJOR security concern&lt;/strong&gt; if you decide to adopt such an authentication mechanism. The attacker can sniff the credentials since they are provided in an almost clear text form. You should at least use an ssl to secure the connection between the client and the server.&lt;/blockquote&gt; The module continues with the user validation and then authenticates the user by creating a GenericPrincipal, which is assigned in the HttpContext.Current.User.  &lt;br /&gt;In order to activate the module you’ll have to declare it in the system.web/httpModules section of your web.config file by adding a line like the following (I have signed my dll and installed it in the GAC):  &lt;br /&gt;&lt;code&gt;   &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;CustomAuthModule&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Abot.Security.BasicAuthenticationModule, Abot.Security, Version=1.0.0.0, Culture=neutral, PublicKeyToken=69ab320f50ed06d0&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;The commented source code of the above mentioned IHttpModule is available in the following link:&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;div style="text-align: center"&gt;&lt;iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="http://cid-956ac40ad45c58c3.photos.live.com/embedicon.aspx/StudentGuruStaff/BasicAuthenticationModule.cs" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;Note that I have used the #if DEBUG declaration in order to provide logging when the dll is built in debug configuration. The logging mechanism is really simple and is not recommended (I could even characterize it as a very bad practice). If you want to implement robust logging, check out &lt;a href="http://weblogs.asp.net/scottgu/archive/2006/05/08/Two-Nice-ASP.NET-Tracing-and-Logging-Articles.aspx" target="_blank"&gt;this ScottGu’s blogpost&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-488796763157177531?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/ukjXQn3eVgw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/488796763157177531/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=488796763157177531" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/488796763157177531?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/488796763157177531?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/ukjXQn3eVgw/aspnet-http-module-to-force.html" title="Asp.net HTTP module to force authenticate user via Basic WWW-Authenticate dialogue" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/TS7hJgqwOkI/AAAAAAAAAIw/xO63M26gnNg/s72-c/IEDefaultLoginForm.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2011/01/aspnet-http-module-to-force.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UEQH0-fSp7ImA9WhZbF0g.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-6152863841674045371</id><published>2010-11-09T19:43:00.004+02:00</published><updated>2011-06-22T18:06:41.355+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-22T18:06:41.355+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="VB.net" /><category scheme="http://www.blogger.com/atom/ns#" term="VCARD" /><title>VCARD quoted-printable decoding and importing to outlook</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;My father replaced an old &lt;a href="http://www.gsmarena.com/lg_ku380-2191.php" target="_blank"&gt;LG KU380&lt;/a&gt; and wanted to transfer his contacts to his new Ericson mobile phone. Unluckily for me, LG provided some software that was promising to synchronize the mobile phone with the outlook, but it wouldn’t stay connected with the phone for more than one minute. Thus, every 100 contacts it would stall and start over again. The next available option was to export the contacts in a vcf file from within the mobile phone and transfer the generated file via Bluetooth.    &lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
The file had the following format:&lt;br /&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:045e77f9-623b-4d07-9b1d-38aa109da872" style="display: inline; float: none; margin: 0px; padding: 0px;"&gt;&lt;pre style="background-color: white; height: 294px; overflow: auto; width: 403px;"&gt;&lt;div&gt;&lt;span style="color: black;"&gt;BEGIN:VCARD
VERSION:&lt;/span&gt;&lt;span style="color: black;"&gt;2.1&lt;/span&gt;&lt;span style="color: black;"&gt;
N&lt;/span&gt;&lt;span style="color: green;"&gt;;&lt;/span&gt;&lt;span style="color: green;"&gt;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:;=CE=91&lt;/span&gt;&lt;span style="color: green;"&gt;
&lt;/span&gt;&lt;span style="color: black;"&gt;TEL&lt;/span&gt;&lt;span style="color: green;"&gt;;&lt;/span&gt;&lt;span style="color: green;"&gt;HOME;CELL;CHARSET=UTF-8:123456789&lt;/span&gt;&lt;span style="color: green;"&gt;
&lt;/span&gt;&lt;span style="color: black;"&gt;REV:20141012T151100Z
END:VCARD
BEGIN:VCARD
VERSION:&lt;/span&gt;&lt;span style="color: black;"&gt;2.1&lt;/span&gt;&lt;span style="color: black;"&gt;
N&lt;/span&gt;&lt;span style="color: green;"&gt;;&lt;/span&gt;&lt;span style="color: green;"&gt;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:;=CE=91=CE=B1&lt;/span&gt;&lt;span style="color: green;"&gt;
&lt;/span&gt;&lt;span style="color: black;"&gt;TEL&lt;/span&gt;&lt;span style="color: green;"&gt;;&lt;/span&gt;&lt;span style="color: green;"&gt;HOME;CELL;CHARSET=UTF-8:6900000000&lt;/span&gt;&lt;span style="color: green;"&gt;
&lt;/span&gt;&lt;span style="color: black;"&gt;REV:20140313T085200Z
END:VCARD
...&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
which is an aggregation of multiple &lt;a href="http://en.wikipedia.org/wiki/VCard" target="_blank"&gt;VCARD&lt;/a&gt;s (starting on BEGIN:VCARD up to END:VCARD) that contained the name of the contact (the lines that starts with N) and some telephones. The problem was that this file was encoded in &lt;a href="http://en.wikipedia.org/wiki/Quoted-printable" target="_blank"&gt;QUOTED-PRINTABLE&lt;/a&gt; using &lt;a href="http://www.wizcity.com/Computers/Characters/GreekUTF8.php" target="_blank"&gt;UTF-8&lt;/a&gt; character set and as you can see from the above sample, Greeks could not be decrypted (even from outlook and live mail). Moreover, LG didn’t support all Greek letters. The names were saved in a &lt;a href="http://en.wikipedia.org/wiki/SMS" target="_blank"&gt;GSM 7-bit&lt;/a&gt; like format (where capital b is used instead of β etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, I had to aggregate the phone numbers of each contact person into a single contact card (instead of having a different vcard for each and every number).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The resulted code (vb.net console application) is well commented and available in the following link:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div align="center"&gt;&lt;iframe title ="Preview" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:98px;height:115px;padding:0;background-color:#fcfcfc;" src="https://skydrive.live.com/embedicon.aspx/StudentGuruStaff/VCFFileConverterModule.zip?cid=956ac40ad45c58c3&amp;sc=photos"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-6152863841674045371?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/SwHKhNQTI7M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/6152863841674045371/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=6152863841674045371" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/6152863841674045371?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/6152863841674045371?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/SwHKhNQTI7M/vcard-quoted-printable-decoding-and.html" title="VCARD quoted-printable decoding and importing to outlook" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>5</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2010/11/vcard-quoted-printable-decoding-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMERHs8eCp7ImA9Wx5VF04.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-6265888806078715658</id><published>2010-10-10T20:56:00.002+03:00</published><updated>2010-10-10T20:56:45.570+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-10T20:56:45.570+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Windows 7" /><category scheme="http://www.blogger.com/atom/ns#" term="manual" /><title>Manual creation helpers</title><content type="html">Ever wanted to create a manual for you application? Well, instead of pressing the print screen button and then editing the captured screens you may use a few build-in tools of windows 7 to help you out. The first tool I would like to mention is the “Snipping Tool” (located in Accessories) which allows you to select the region you want to capture and then edit it. The second one is the amazing “Problem Steps Recorder” (psr.exe located in windows\system32 folder) which allows you to record the steps you do and writes a pretty nice tutorial for you. The only problem is that it takes full screen pictures, but you can always resize the screen resolution and hide the start menu bar.&lt;br /&gt;
&lt;br /&gt;
Hope this will help save a few hours from the nasty manual making job!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-6265888806078715658?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/NQdquKLdZko" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/6265888806078715658/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=6265888806078715658" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/6265888806078715658?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/6265888806078715658?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/NQdquKLdZko/manual-creation-helpers.html" title="Manual creation helpers" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2010/10/manual-creation-helpers.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUAQHozeip7ImA9WxFaE0g.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-5937619104001093904</id><published>2010-07-17T11:57:00.002+03:00</published><updated>2010-07-17T12:00:41.482+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-17T12:00:41.482+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Authentication" /><category scheme="http://www.blogger.com/atom/ns#" term="VB.net" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows Identity Foundation" /><category scheme="http://www.blogger.com/atom/ns#" term="Claims Based Security" /><category scheme="http://www.blogger.com/atom/ns#" term="membership" /><title>Windows Indentity Foundation – Custom Security Token Service and the relying party configuration</title><content type="html">The last couple of days I’ve been coding with the Windows Identity Foundation (WIF) in order to create a WS Federation Security Token Service (STS) that provides the user authentication for multiple relying parties (RPs). I decided to write a small tutorial and a sample (full commented) project that describes the basic steps that are required in order to setup the authentication via passive federation. &lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
First of all you should start by downloading the Windows Identity Foundation (aka WIF) from &lt;a href="http://msdn.microsoft.com/en-us/evalcenter/dd440951.aspx"&gt;Microsoft&lt;/a&gt;. This download provides all the necessary dlls (including System.IdentityModel and Microsoft.IdentityModel) to build a WIF claim based application.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;The second thing you have to do is download the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c148b2df-c7af-46bb-9162-2c9422208504&amp;amp;displaylang=en"&gt;Windows Identity Foundation SDK&lt;/a&gt; that integrates into visual studio and provides many helpful examples. This download provides the FedUtil.exe also known as Federation Utility that automatically configures the trust between an RP and an STS and also auto generates a custom STS based on your RP configuration file.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;Having installed the two prerequisites, you may download the sample project I have created, from the following link, and look for the comments that start with “WIF Comment:” in order to locate the code that is WIF specific.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://cid-956ac40ad45c58c3.photos.live.com/embedicon.aspx/StudentGuruStaff/WIFSimpleSTSDemo.zip" style="background-color: #fcfcfc; height: 115px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 98px;" title="Preview"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;b&gt;Project description&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;As I mentioned earlier I wanted to create a simple &lt;a href="http://msdn.microsoft.com/en-us/library/ee539091.aspx"&gt;claim based&lt;/a&gt; web site application (see a couple of reasons on why you may need to create one on my &lt;a href="http://botsikas.blogspot.com/2010/06/need-of-claim-based-security-model-and.html"&gt;previous post&lt;/a&gt;). In fact the downloaded solution contains two relying parties. One (RelyingParty) that was manually created from start to end (ok I admit that the design is created by vs) and another one (AutoconfiguredRelayingParty) that was configured almost entirely by the Federation Utility that comes with the WIF SDK. Let’s see the RelyingParty project first.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;i&gt;The RelyingParty (RP) web application&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
This is the default asp.net application that was created from the visual studio templates. I have stripped off the entire FormsAuthentication mechanism that comes with the original template (deleted the appropriate folder) and modified the web.config to enable the WS Federation Authentication. &lt;br /&gt;
&lt;br /&gt;
One thing you should note is that we have completely disabled the asp.net’s build in authentication by setting the mode to None and on the other hand we have denied unauthenticated users by setting «deny users="?"». The next thing we did was to add the WS Federation httpmodules in the asp.net’s modules stack (under the httpModules for IIS6 and the webdev server visual studio runs and under system.webServer.Modules for IIS 7+). These modules will be handling the authentication requests of our application. In order to configure them we will have to introduce a new configuration section in our web.config file by adding the corresponding section declaration in the configSections region on the top of our configuration file. We added the &lt;a href="http://blogs.msdn.com/b/vbertocci/archive/2010/05/11/a-hidden-gem-the-wif-config-schema.aspx"&gt;microsoft.identityModel section&lt;/a&gt; which is heavily commented in the downloaded source code. The most important parts of this section are:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The applicationService\claimTypeRequired part where you specify the claims your application requests from the STS.&lt;/li&gt;
&lt;li&gt;The passiveRedirectEnabled="true" set in the wsFederation section that enable the passive redirect to the STS whenever authentication is required&lt;/li&gt;
&lt;/ul&gt;One more thing to note is that I have disabled all the certificate checks that are made by WIF in order to simplify the demo. Normally, the RP receives and installs in the computer it runs the STS’s certificate in order to verify each message it receives by checking the signature and STS installs the public key of RP in order to encrypt the authentication messages so as to ensure the trust between both parties. WIF supports a lot of certificate lookup mechanisms but it also requires valid certificates which are not easy to get your hands on. If on the other hand you want to play around with the certificates functionality, you may use the custom WIFCommonLibrary.Certificate.CustomX509CertificateValidator x509 certificate validator which reads the certificate from the embedded resources (thus you’ll not have to install your certificate in the machines certificate store). See the web.config comments on how to enable this functionality.&lt;br /&gt;
&lt;br /&gt;
One final thing you should note in the web.config file is the requestValidationType="WIFCommonLibrary.Web.AllowWFClaimsRequestValidator" set in the httpRuntime. By overriding the request validation, we will be allowing the federation form requests that will be coming into our application. If you don’t do so, you will get a «A potentially dangerous Request.Form value was detected from the client (wresult="trust:RequestSecuri..."» error due to the default asp.net’s request validation that prevents suspicious requests.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_cEyHt5Ws5Ko/TA-MNx39hDI/AAAAAAAAAIA/xDEI5-IK7bg/s1600/RequestError.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" hw="true" src="http://1.bp.blogspot.com/_cEyHt5Ws5Ko/TA-MNx39hDI/AAAAAAAAAIA/xDEI5-IK7bg/s320/RequestError.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;On the Default page I have added the code to display the claims that are associated with the authenticated user. On the Site.Master page I have modified the logout functionality by tampering the asp:LoginStatus to redirect to the SignOut page and finally in the the SignOut page I have a simple call to Microsoft.IdentityModel.Web.FederatedAuthentication.WSFederationAuthenticationModule.SignOut which ensures that you log out the user. Note that you’ll have to redirect the user because the request is authenticated and the user will end up seeing the page. If you allow the user to see the page, on the next request, he will not pass the authentication stage and thus he will end up with the STS’s login screen (automatically driven there because we have enabled the passiveRedirectEnabled).&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;The SecurityTokenService (STS) web application&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
The STS consists of two web pages:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The default.aspx which will be creating the federating identity and&lt;/li&gt;
&lt;li&gt;The login.aspx which will be authenticating the incoming users.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;The STS is a simple web application (in a manner of speech). If you take a look in the web.config, perhaps you will be surprised to see that there is no identity configuration. It only contains a simple FormsAuthentication declaration. In order to keep the demo simple, I have decided to use asp.net’s default forms authentication in order to verify my users. This means that you can simply add your own membership provider and verify the users on any source you like. One more thing you have to note is that I don’t allow any unauthenticated user to see the default page (the one responsible for creating the federation token). This means that when the RP calls the STS for a security token, the request is automatically redirected to the STS’s login screen where the user has to present his credentials, and then he is redirected to the default page which redirects the user back to the RP passing the security token. This is depicted in the following sequence diagram:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_cEyHt5Ws5Ko/TEFu0S98tjI/AAAAAAAAAII/Xf2plzZLMPw/s1600/WIFFederation.sequencediagram.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="170" hw="true" src="http://3.bp.blogspot.com/_cEyHt5Ws5Ko/TEFu0S98tjI/AAAAAAAAAII/Xf2plzZLMPw/s320/WIFFederation.sequencediagram.jpg" width="320" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;The nice thing about WIF is that this is totally transparent to the end user. The regular end user will not even notice that he is redirected to another place (the STS).&lt;br /&gt;
&lt;br /&gt;
The default page contains the code that handles the federation requests (signin and signout) and there are not many things you should modify in this page. The hard work of the STS is located in the folder SecurityTokenService where the customsecuritytokenservice is defined.&lt;br /&gt;
&lt;br /&gt;
CustomSecurityTokenServiceConfiguration refers to the configuration of the STS and provides a single instance access of this configuration (thus you’ll not have to set the security token service’s configuration over and over again). Note that we initialize the STS’s certificate calling the CertificateUtil.GetCertificate() method which retrieves the certificate from the embedded resources. In the actual production STS you should retrieve the certificate from the computer’s certificate store! &lt;br /&gt;
&lt;br /&gt;
CustomSecurityTokenService is the actual STS. It inherits Microsoft.IdentityModel.SecurityTokenService.SecurityTokenService, it handles the requests and provides the requested ClaimsIdentity based on the authenticated user’s properties. To keep this demo simple, I have hard coded the output claims, but you should probably add some database lookup mechanism in order to retrieve each user’s claims. The place to add this kind of mechanism is the overridden GetOutputClaimsIdentity method.&lt;br /&gt;
&lt;br /&gt;
The last file you should probably see is \FederationMetadata\2007-06\FederationMetadata.xml which is a descriptive metadata file of the STS’s capabilities. It describes in the oasis standards what are the available claims, who is responsible for this STS, how can you access this STS and staff like that. In order to create these files please refer to the &lt;a href="http://botsikas.blogspot.com/2010/06/federation-metadata-editor-on-codeplex.html"&gt;WIF Custom STS metadata file editor&lt;/a&gt; I have created in a previous post.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;The AutoconfiguredRelayingParty (RP) web application&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Having created the STS you may now have the Federation Utility (found in the WIF SDK) to automatically configure your RP. To demonstrate this functionality I have created another empty asp.net web application and used the tool to pair it with my new STS. To see how this is done, please refer to my older post &lt;a href="http://botsikas.blogspot.com/2010/06/how-to-associate-web-application-rp-to.html"&gt;found here&lt;/a&gt;.&lt;br /&gt;
The only thing you should note is that you’ll have to manually set the requestValidationType to allow the federation token form posts, as mentioned in the previous relying party (or you can see the web.config comments).&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;i&gt;The WIFCommonLibrary library&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;This library contains some useful classes that I have gathered together in order to facilitate the development of custom STSs and RPs. They are only for developing and testing purposes and should never be used in the actual production applications. Both available classes are discussed in the previous sections of this article.&lt;/div&gt;&lt;br /&gt;
Hope this article and the source code will help you get started with the windows identity foundation!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-5937619104001093904?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/7k-c2VSZ-nU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/5937619104001093904/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=5937619104001093904" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/5937619104001093904?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/5937619104001093904?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/7k-c2VSZ-nU/windows-indentity-foundation-custom.html" title="Windows Indentity Foundation – Custom Security Token Service and the relying party configuration" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_cEyHt5Ws5Ko/TA-MNx39hDI/AAAAAAAAAIA/xDEI5-IK7bg/s72-c/RequestError.jpg" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2010/07/windows-indentity-foundation-custom.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMGRHkyeyp7ImA9WxFaE0g.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-4873526865583200773</id><published>2010-06-09T15:46:00.006+03:00</published><updated>2010-07-17T12:03:45.793+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-17T12:03:45.793+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Authentication" /><category scheme="http://www.blogger.com/atom/ns#" term="WIF" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows Identity Foundation" /><category scheme="http://www.blogger.com/atom/ns#" term="Custom STS" /><category scheme="http://www.blogger.com/atom/ns#" term="Federation" /><title>How to associate a web application (RP) to an existing Security Token Service (STS) using Federation Utility (FedUtil.exe)</title><content type="html">&lt;div style="text-align: justify;"&gt;Federation utility is a very nice little tool that can automatically configure your claim based web application (which is called Relying Party or RP in the Federation language) to trust an existing security token service (STS). It comes with WIF SDK available from &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c148b2df-c7af-46bb-9162-2c9422208504&amp;amp;displaylang=en"&gt;Microsoft&lt;/a&gt;. This tool can also create a new STS based on your own claim based web application, but this is not on the scope of the current post.&lt;/div&gt;In order to establish the trust you’ll have to do the following steps:&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Right click on you project and select the “Add STS Reference…”. If you haven’t got the WIF SDK extensions installed on your computer, you may run the tool from C:\Program Files (x86)\Windows Identity Foundation SDK\v4.0\FedUtil.exe (removing the x86 on x32 operating systems).&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_cEyHt5Ws5Ko/TA-J7bdu5jI/AAAAAAAAAGg/Qu-kA8tOmu0/s1600/Step1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="http://1.bp.blogspot.com/_cEyHt5Ws5Ko/TA-J7bdu5jI/AAAAAAAAAGg/Qu-kA8tOmu0/s320/Step1.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;Fill in your RP application info and click next.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_cEyHt5Ws5Ko/TA-KE48OWQI/AAAAAAAAAGw/_hixA1E5z7Q/s1600/Step2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="http://3.bp.blogspot.com/_cEyHt5Ws5Ko/TA-KE48OWQI/AAAAAAAAAGw/_hixA1E5z7Q/s320/Step2.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;On this stage you may face the following error (unless you have your website on a secure https layer):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_cEyHt5Ws5Ko/TA-KYgiIwWI/AAAAAAAAAG4/0dwMokWogYk/s1600/Step2Warning.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="http://4.bp.blogspot.com/_cEyHt5Ws5Ko/TA-KYgiIwWI/AAAAAAAAAG4/0dwMokWogYk/s320/Step2Warning.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Locate the STS’s Federation Metadata xml file (usually located on http://sts-address/FederationMetadata/2007-06/FederationMetadata.xml) and click next.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_cEyHt5Ws5Ko/TA-LnPj5XPI/AAAAAAAAAHI/Zlzdbm4uYQE/s1600/Step3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="http://3.bp.blogspot.com/_cEyHt5Ws5Ko/TA-LnPj5XPI/AAAAAAAAAHI/Zlzdbm4uYQE/s320/Step3.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
On this stage you may receive up to three warnings depending on your STS’s security settings.&lt;br /&gt;
The first one refers to the lack of digital sign on the federation metadata file. &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_cEyHt5Ws5Ko/TA-LjhPje-I/AAAAAAAAAHA/iST9wE-IOsM/s1600/Step3Warning1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="http://3.bp.blogspot.com/_cEyHt5Ws5Ko/TA-LjhPje-I/AAAAAAAAAHA/iST9wE-IOsM/s320/Step3Warning1.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The second one refers to the lack of an https endpoint on the service. If you want to avoid this message, then you should probably have an ssl installed in the hosting computer that serves the STS.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_cEyHt5Ws5Ko/TA-LsW7-x5I/AAAAAAAAAHQ/F66IFGHME9g/s1600/Step3Warning2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="http://1.bp.blogspot.com/_cEyHt5Ws5Ko/TA-LsW7-x5I/AAAAAAAAAHQ/F66IFGHME9g/s320/Step3Warning2.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The third warning refers to the lack of valid certificate on the STS. If your server runs on a developing certificate, the tool will not be able to validate the certificate. That’s ok on dev environments but should not be the case in production level.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_cEyHt5Ws5Ko/TA-Lv0onO3I/AAAAAAAAAHY/a5B2FwoykR8/s1600/Step3Warning3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="http://4.bp.blogspot.com/_cEyHt5Ws5Ko/TA-Lv0onO3I/AAAAAAAAAHY/a5B2FwoykR8/s320/Step3Warning3.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
On the next screen you will be prompted to provide a certificate for your own claim based application. You may specify the certificate with which the STS will be encrypting the communication between the RP and the STS. The point of this certificate is to encrypt the messages in a way that only the requesting RP will be able to understand. If you leave this blank, then the messages will not be encrypted.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_cEyHt5Ws5Ko/TA-L1dd25nI/AAAAAAAAAHg/b7nkzG3-1io/s1600/Step4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="http://1.bp.blogspot.com/_cEyHt5Ws5Ko/TA-L1dd25nI/AAAAAAAAAHg/b7nkzG3-1io/s320/Step4.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Clicking next you will see the available claims on the STS. Nothing to do here…&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/TA-L7Mm8caI/AAAAAAAAAHo/96HiSknibOU/s1600/Step5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/TA-L7Mm8caI/AAAAAAAAAHo/96HiSknibOU/s320/Step5.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The final step is the overview.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/TA-MEdaTqoI/AAAAAAAAAHw/MrY0xtWuKL8/s1600/Step6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/TA-MEdaTqoI/AAAAAAAAAHw/MrY0xtWuKL8/s320/Step6.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Click finish and you are done.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_cEyHt5Ws5Ko/TA-MHzsL7oI/AAAAAAAAAH4/JgoXHRTmkCA/s1600/Finish.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="http://4.bp.blogspot.com/_cEyHt5Ws5Ko/TA-MHzsL7oI/AAAAAAAAAH4/JgoXHRTmkCA/s320/Finish.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Let us test the application. Clicking debug you will actually reach the STS, do the authentication and by the time you come back to your claim based application you receive an ugly message «A potentially dangerous Request.Form value was detected from the client (wresult=» &lt;br /&gt;
&lt;div="" class="separator" style="clear: both; text-align: center;"&gt;&lt;div align="center"&gt;&lt;a href="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/TA-MNx39hDI/AAAAAAAAAIA/xDEI5-IK7bg/s1600/RequestError.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/TA-MNx39hDI/AAAAAAAAAIA/xDEI5-IK7bg/s320/RequestError.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;In order to fix this error you must modify the web.config and set an http runtime request validator that allows the federation messages to pass through. For example it would look like the following statement:&lt;br /&gt;
&lt;blockquote&gt;httpruntime requestvalidationtype="WIFCommonLibrary.Web.AllowWFClaimsRequestValidator"&lt;/blockquote&gt;&lt;br /&gt;
(You may download the implementation of this custom Request Validator from this &lt;a href="http://botsikas.blogspot.com/2010/07/windows-indentity-foundation-custom.html"&gt;post&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
That’s it, your RP is configured to trust the new STS. You may change the requested claims from your web.config file.&lt;br /&gt;
&lt;br /&gt;
Happy federation!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-4873526865583200773?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/OeQ5XFR42Yo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/4873526865583200773/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=4873526865583200773" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/4873526865583200773?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/4873526865583200773?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/OeQ5XFR42Yo/how-to-associate-web-application-rp-to.html" title="How to associate a web application (RP) to an existing Security Token Service (STS) using Federation Utility (FedUtil.exe)" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_cEyHt5Ws5Ko/TA-J7bdu5jI/AAAAAAAAAGg/Qu-kA8tOmu0/s72-c/Step1.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2010/06/how-to-associate-web-application-rp-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUNRH0_cCp7ImA9WxFaE0g.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-5835798025686617777</id><published>2010-06-09T13:56:00.001+03:00</published><updated>2010-07-17T12:01:35.348+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-17T12:01:35.348+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Authentication" /><category scheme="http://www.blogger.com/atom/ns#" term="WIF" /><category scheme="http://www.blogger.com/atom/ns#" term="Metadata" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows Identity Foundation" /><category scheme="http://www.blogger.com/atom/ns#" term="Federation" /><title>Federation Metadata Editor on codeplex</title><content type="html">I have just opened a new project on codeplex to host the source code of&amp;nbsp; the Federation Metadata Editor I mentioned on my &lt;a href="http://botsikas.blogspot.com/2010/06/wif-custom-sts-metadata-file-editor.html"&gt;previous post&lt;/a&gt;. Check it out at &lt;a href="http://stsmetadataeditor.codeplex.com/"&gt;http://stsmetadataeditor.codeplex.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-5835798025686617777?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/KrA_s5zwKcg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/5835798025686617777/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=5835798025686617777" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/5835798025686617777?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/5835798025686617777?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/KrA_s5zwKcg/federation-metadata-editor-on-codeplex.html" title="Federation Metadata Editor on codeplex" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2010/06/federation-metadata-editor-on-codeplex.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcGQ3szfip7ImA9WxFVEEw.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-8293450910566657056</id><published>2010-06-08T18:47:00.000+03:00</published><updated>2010-06-08T18:47:02.586+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-08T18:47:02.586+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Authentication" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows Identity Foundation" /><category scheme="http://www.blogger.com/atom/ns#" term="Claims Based Security" /><title>The need of claim based security model and identity federation</title><content type="html">The last couple of days I have been working on Windows Identity Foundation. In order to take advantage of this framework, you should start writing claim based application. Forget the old fashion role based and start demanding claims! Why to convert to claim based application you may wonder... There are many reasons why you should do that but the most appealing ones I can think of are the following:&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Security granularity. You can demand specific claims from a user in order to do a specific action in your application. For example, imagine that you have a simple calendar application. You may demand a “read calendar” claim from the users in order to view the contents and request another “edit calendar entries” claim in order to edit the contents. By demanding claims, you don’t have to know the application’s roles a priory. You define the claims the user must have in order to access the specified code and when you finish, you may optionally associate the application roles to specific claims, thus enabling the role “managers” to have both the “read calendar” and “edit calendar entries” claims. You may specify as many claims as you like, thus enabling you to have total control on the access levels you may offer on your application.&lt;/li&gt;
&lt;li&gt;No need to write the authentication mechanism and maintain user’s database. Although with the asp.net membership providers you may automatically create the users table in your database and not bother with the authentication mechanism, Federation provides you with the tools to trust others to authenticate users for you. You don’t even have to have a user’s table in your database. Someone else (an STS) will do the authentication for you and sent you the user’s security claims. This may not seem as a benefit in the beginning but if you see the bigger problem you will understand the importance of this feature. There are two benefits from authentication federation.&amp;nbsp;&lt;ul&gt;&lt;li&gt;It’s very common to have an intranet and have a couple of applications running inside it. These applications authenticate their users based on their own authentication mechanism, which means a lot of user tables on different databases. Having a single Security Token Service, you may have all your applications ask this STS for the user authentication which will centralize the users in one database, thus decreasing drastically your user administration efforts. In the best case scenario the intranet applications use windows authentication if there is an Active Directory (or another Kerberos authentication mechanism) in the domain. In this case, the Security Token Service comes as an intermediate security layer which abstracts the authentication mechanism by authenticating the users and providing the relying parties (your applications) an authenticated identity that has some claims. Thus your application doesn’t have to be tied up with an Active Directory and you may change the authentication method at any time (let’s say have smart card installed or issue certificates) without breaking your applications. The only thing you’ll have to do is reconfigure the STS to accept the new authentication method.&lt;/li&gt;
&lt;li&gt;The second benefit comes when you want to externalize an intranet application. In this case, you’ll be authenticating both your intranet users and some external users from another company (let’s name this other company Contoso). If you have a custom authentication, you’ll have to add the new users and send them their new credentials which mean that the users will have to remember a new set of credentials and you’ll have to keep track of the new users and remove them in case they leave Contoso. One think is for granted. The Contoso’s HR department will not call you if they fire a person and you’ll have to manually call and find the current employment status. If on the other hand you had simply trusted Contoso’s authentication mechanism and simply allow the specific users to access your externalized application, then all problems are solved. This is called identity federation (http://en.wikipedia.org/wiki/Federated_identity). Whenever a user from Contoso comes to your application, you ask the trusted Contoso’s STS to authenticate the user and have your STS to simply transform the claims to the ones that are recognized by your applications (if there claims mapping is needed).&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;/ol&gt;Fill free to add as a comment any other reason you may think of...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-8293450910566657056?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/TP7-b6CIYsM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/8293450910566657056/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=8293450910566657056" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/8293450910566657056?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/8293450910566657056?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/TP7-b6CIYsM/need-of-claim-based-security-model-and.html" title="The need of claim based security model and identity federation" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2010/06/need-of-claim-based-security-model-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UMQXo9cSp7ImA9WxFWF0s.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-3012038630375056430</id><published>2010-06-05T23:21:00.000+03:00</published><updated>2010-06-05T23:21:20.469+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-05T23:21:20.469+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="save-password option" /><category scheme="http://www.blogger.com/atom/ns#" term="openvpn" /><title>Building openvpn 2.1.1 with enable-password-save on windows</title><content type="html">&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Lately I’ve been having some requests on how to build openvpn 2.1.1 with enable-password-save.&amp;nbsp;The truth is that a few things have changed since my &lt;a href="http://botsikas.blogspot.com/2008/10/building-openvpn-with-enable-password.html"&gt;last post&lt;/a&gt;. In order to fill these requests I decided to write down a few things about the process. If you are intrested in downloading an allready compiled version or openvpn 2.1.1 with enable-password-save, &lt;a href="http://botsikas.blogspot.com/2010/03/openvpn-211-with-save-password-enabled.html"&gt;check out this post&lt;/a&gt;.&lt;/div&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Before you start, you should download the following source files from &lt;a href="http://www.openvpn.net/index.php/open-source/downloads.html"&gt;openvpn.net&lt;/a&gt; &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style="text-align: justify;"&gt;2.1_rc22-prebuilt.tbz&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style="text-align: justify;"&gt;openvpn-2.1.1.zip&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style="text-align: justify;"&gt;openvpn_install_source-2.1beta7-gui-1.0.3.zip&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style="text-align: justify;"&gt;openvpn-gui-1.0.3.zip&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;For the &lt;a href="http://sourceforge.net/downloads/mingw/"&gt;MinGW&lt;/a&gt; you should download&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style="text-align: justify;"&gt;binutils-2.20-1-mingw32-bin.tar.gz&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;gcc-ada-3.4.5-20060117-3.tar.gz&lt;/li&gt;
&lt;li&gt;gcc-core-3.4.5-20060117-3.tar.gz&lt;/li&gt;
&lt;li&gt;gcc-g++-3.4.5-20060117-3.tar.gz&lt;/li&gt;
&lt;li&gt;gcc-g77-3.4.5-20060117-3.tar.gz&lt;/li&gt;
&lt;li&gt;gcc-java-3.4.5-20060117-3.tar.gz&lt;/li&gt;
&lt;li&gt;gcc-objc-3.4.5-20060117-3.tar.gz&lt;/li&gt;
&lt;li&gt;make-3.81-20090914-mingw32-bin.tar.gz&lt;/li&gt;
&lt;li&gt;MinGW-5.1.6.exe&lt;/li&gt;
&lt;li&gt;mingw.ini&lt;/li&gt;
&lt;li&gt;mingwrt-3.17-mingw32-dev.tar.gz&lt;/li&gt;
&lt;li&gt;mingwrt-3.17-mingw32-dll.tar.gz&lt;/li&gt;
&lt;li&gt;w32api-3.14-mingw32-dev.tar.gz&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div&gt;and the following add-ons &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style="text-align: justify;"&gt;autoconf2.5-2.64-1-mingw32-bin.tar.tar&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style="text-align: justify;"&gt;automake-4-1-mingw32-bin.tar.tar&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style="text-align: justify;"&gt;automake1.11-1.11-1-mingw32-bin.tar.tar&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style="text-align: justify;"&gt;gettext-0.17-1-mingw32-bin.tar.tar&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style="text-align: justify;"&gt;libcrypt-1.1_1-2-msys-1.0.11-dll-0.tar.tar&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style="text-align: justify;"&gt;libgettextpo-0.17-1-mingw32-dll-0.tar.tar&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style="text-align: justify;"&gt;libintl-0.17-1-mingw32-dll-8.tar.tar&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style="text-align: justify;"&gt;m4-1.4.13-1-msys-1.0.11-bin.tar.tar&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style="text-align: justify;"&gt;perl-5.6.1_2-1-msys-1.0.11-bin.tar.tar&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;The software I used during the development is the following:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style="text-align: justify;"&gt;MSYS-1.0.11.exe&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;nsis-2.46-setup.exe (NSIS by nullsoft)&lt;/li&gt;
&lt;li&gt;npp.5.6.8.Installer.exe (Notepad++ a very nice light editor)&lt;/li&gt;
&lt;li&gt;7z465.exe (7-zip for archive manipulation)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div&gt;One final thing is that you should probably&amp;nbsp;modify the install-win32\settings.in file and set the parameters there to reflect your files' location. For example, in order to use the prebuild driver you should uncomment the line that reads &lt;/div&gt;&lt;div style="text-align: center;"&gt;;!define GENOUT_PREBUILT "../gen-prebuilt"&lt;/div&gt;&lt;div style="text-align: justify;"&gt;and add the required prebuild driver in that directory. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Hope that this update will help you build your own openvpn!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-3012038630375056430?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/ej6kQesZaWI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/3012038630375056430/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=3012038630375056430" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/3012038630375056430?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/3012038630375056430?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/ej6kQesZaWI/building-openvpn-211-with-enable.html" title="Building openvpn 2.1.1 with enable-password-save on windows" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2010/06/building-openvpn-211-with-enable.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUIHQ3k7fSp7ImA9WxFWF0s.&quot;"><id>tag:blogger.com,1999:blog-7761120478392541874.post-5359253119913263441</id><published>2010-06-05T22:51:00.001+03:00</published><updated>2010-06-05T22:52:12.705+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-05T22:52:12.705+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="VB.net" /><category scheme="http://www.blogger.com/atom/ns#" term="routing" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><category scheme="http://www.blogger.com/atom/ns#" term="SEO" /><category scheme="http://www.blogger.com/atom/ns#" term="Url rewrite" /><title>Asp.net 4.0 URL rewriting aka Routing</title><content type="html">&lt;div style="text-align: justify;"&gt;Are you tired of having ugly urls in your website like product.aspx?product=1? Are you concerned about having a search engine optimized web site? Asp.net provides the mean to easily rewrite your urls via the System.Web.Routing namespace. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;I have composed a simple asp.net website with lots of comments in it, that demonstrates this new (not so new actually because this mechanism exists since .net 3.5 sp1) mechanism. &lt;/div&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Download the source from the link below:&lt;br /&gt;
&lt;div style="text-align: center;"&gt;&lt;iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://cid-956ac40ad45c58c3.skydrive.live.com/embedicon.aspx/StudentGuruStaff/SimpleUrlRoutingWebSite.zip" style="background-color: #fcfcfc; height: 115px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 98px;" title="Preview"&gt;&lt;/iframe&gt;&lt;/div&gt;The main benefits of this website are:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;User friendly urls like /product/1/My_First_Item&lt;/li&gt;
&lt;li&gt;Search engine optimization (no error in the &lt;a href="http://www.iis.net/download/seotoolkit"&gt;SEO Toolkit&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Ease on url rewrite rules&lt;/li&gt;
&lt;/ul&gt;Things you should see:&lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Global.asax.vb&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;During the startup of our application we define the routes. This means that whenever you change the routes, you should close the webdev server in order to reinitiate the application. In the Application_Start you will find the use of RouteTable.Routes.MapPageRoute and its overloads which provides an easy way to defines routes, while you will also find the use of the method RouteTable.Routes.Add which allows us to define our own RouteHandler. &lt;/div&gt;&lt;strong&gt;&lt;u&gt;Default.aspx(.vb)&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;This page demonstrates the simple use of the pages property RouteData which contains the routed data gathered by the url. Be sure to check out that we avoid rewriting the url for view1 in order to avoid any warning from the SEO toolkit (duplicate entry point of the same page, one with no arguments and /Home/1). In the aspx file you will also see the use of the new expression which gets the url by matching the used arguments to the routing rule. &lt;/div&gt;&lt;strong&gt;&lt;u&gt;ProductListing.aspx.vb&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;In this file you will see the use of RouteTable.Routes.GetVirtualPath which returns the link to the requested resource as it’s mapped via the defined rules.&lt;/div&gt;&lt;strong&gt;&lt;u&gt;Product.aspx.vb&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;In this file you’ll find two classes. The partial class of the corresponding page and ProductRoutingHandler which implements the IRouteHandler interface in order to provide a little bit more complex logic in the Routing. This handlers loads the data of the product (based on the url’s id) and returns the loaded web page or returns a ProductNotFound.aspx web page as the result of this request…&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Since you are looking in that page, check out the new MetaDescription and MetaKeywords properties of the Page which allows us to easily manipulate those head meta tags (one of the best practices in SEO).&lt;/div&gt;&lt;br /&gt;
Hope this project gives you a kick start on routing!&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7761120478392541874-5359253119913263441?l=botsikas.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BotsikasBlog/~4/DQXRCa7n3uw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://botsikas.blogspot.com/feeds/5359253119913263441/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7761120478392541874&amp;postID=5359253119913263441" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/5359253119913263441?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7761120478392541874/posts/default/5359253119913263441?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BotsikasBlog/~3/DQXRCa7n3uw/aspnet-40-url-rewriting-aka-routing.html" title="Asp.net 4.0 URL rewriting aka Routing" /><author><name>Andreas Botsikas</name><uri>http://www.blogger.com/profile/01752587180565072980</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://2.bp.blogspot.com/_cEyHt5Ws5Ko/SUomUHIFlyI/AAAAAAAAACM/9ozvoO6YpKM/S220/Abot.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://botsikas.blogspot.com/2010/06/aspnet-40-url-rewriting-aka-routing.html</feedburner:origLink></entry></feed>

