<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://code.msdn.microsoft.com/rss.xsl"?><rss version="2.0"><channel><title>Bala's Code gallery: Role Management using cookies</title><link>http://code.msdn.microsoft.com/nbalagopal/Project/ProjectRss.aspx</link><description>Making role management in ASP.NET forms authentication easier.      Implementing forms authentication in an ASP.NET is quite easy using cookies. A few entries in the web.config and a few lines of code ...</description><item><title>UPDATED RELEASE: Blaze Security Release v1.0 (Feb 14, 2008)</title><link>http://code.msdn.microsoft.com/nbalagopal/Release/ProjectReleases.aspx?ReleaseId=215</link><description>How to Use&amp;#58;&lt;br /&gt;&lt;br /&gt;1. Download the dll and add the reference to your website.&lt;br /&gt;&lt;br /&gt;2. Validate the user credentials and if succesful create the cookie using&lt;br /&gt;&lt;br /&gt;      &amp;#43;Blaze.Security.FormsSecurity.SetAuthenticationCookie&amp;#40;string username, double expiration, bool isPersistent, string roles&amp;#41;&amp;#43;&lt;br /&gt;        &amp;#40;The roles of the user can be mentioned in the fourth parameter separated by &amp;#39;,&amp;#39;&amp;#41;.&lt;br /&gt;&lt;br /&gt;3. Add the Global Application Class file &amp;#40;Global.asax&amp;#41; to your website.&lt;br /&gt;&lt;br /&gt;4. Copy and paste the following code into the Global.asax.&lt;br /&gt;   &lt;br /&gt;    void Application_AuthenticateRequest&amp;#40;object sender, EventArgs e&amp;#41;&lt;br /&gt;    &amp;#123;&lt;br /&gt;        &amp;#47;&amp;#47; Code that runs on application authenticate event.&lt;br /&gt;        Blaze.Security.FormsSecurity.InsertPrincipal&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;        &lt;br /&gt;    &amp;#125;&lt;br /&gt;&lt;br /&gt;5. Add entries to your web.config just as you would while using normal forms authentication&lt;br /&gt;&amp;#60;configuration&amp;#62;&lt;br /&gt;   &amp;#60;system.web&amp;#62;&lt;br /&gt;    .......&lt;br /&gt;     &amp;#60;authentication mode&amp;#61;&amp;#34;Forms&amp;#34;&amp;#62;&lt;br /&gt;        &amp;#60;forms loginUrl&amp;#61;&amp;#34; .....&amp;#34;&amp;#62;&amp;#60;&amp;#47;forms&amp;#62;&lt;br /&gt;     &amp;#60;&amp;#47;authentication&amp;#62;&lt;br /&gt;    ......&lt;br /&gt;   &amp;#60;&amp;#47;system.web&amp;#62;&lt;br /&gt;   &amp;#60;location path&amp;#61;&amp;#34;....path...&amp;#34;&amp;#62;&lt;br /&gt;     &amp;#60;system.web&amp;#62;&lt;br /&gt;       &amp;#60;authorization&amp;#62;&lt;br /&gt;           &amp;#60;allow roles&amp;#61;&amp;#34;....Roles separated by coma.....&amp;#34;&amp;#47;&amp;#62;&lt;br /&gt;&amp;#9;&amp;#60;deny users&amp;#61;&amp;#34;&amp;#42;&amp;#34;&amp;#47;&amp;#62;&lt;br /&gt;       &amp;#60;&amp;#47;authorization&amp;#62;&lt;br /&gt;     &amp;#60;&amp;#47;system.web&amp;#62;&lt;br /&gt;   &amp;#60;&amp;#47;location&amp;#62;&lt;br /&gt;&amp;#60;&amp;#47;configuration&amp;#62;&lt;br /&gt;</description><author></author><pubDate>Thu, 14 Feb 2008 10:14:54 GMT</pubDate><guid isPermaLink="false">UPDATED RELEASE: Blaze Security Release v1.0 (Feb 14, 2008) 20080214A</guid></item><item><title>CREATED RELEASE: Blaze Security Release v1.0 (Feb 14, 2008)</title><link>http://code.msdn.microsoft.com/nbalagopal/Release/ProjectReleases.aspx?ReleaseId=215</link><description>How to Use&amp;#58;&lt;br /&gt;&lt;br /&gt;1. Download the dll and add the reference to your website.&lt;br /&gt;2. Validate the user credentials and if succesful create the cookie using&lt;br /&gt;&lt;br /&gt;      &amp;#43;Blaze.Security.FormsSecurity.SetAuthenticationCookie&amp;#40;string username, double expiration, bool isPersistent, string roles&amp;#41;&amp;#43;&lt;br /&gt;        &amp;#40;The roles of the user can be mentioned in the fourth parameter separated by &amp;#39;,&amp;#39;&amp;#41;.&lt;br /&gt;3. Add the Global Application Class file &amp;#40;Global.asax&amp;#41; to your website.&lt;br /&gt;4. Copy and paste the following code into the Global.asax.&lt;br /&gt;   &lt;br /&gt;    void Application_AuthenticateRequest&amp;#40;object sender, EventArgs e&amp;#41;&lt;br /&gt;    &amp;#123;&lt;br /&gt;        &amp;#47;&amp;#47; Code that runs on application authenticate event.&lt;br /&gt;        Blaze.Security.FormsSecurity.InsertPrincipal&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;        &lt;br /&gt;    &amp;#125;&lt;br /&gt;5. Add entries to your web.config just as you would while using normal forms authentication&lt;br /&gt;&amp;#60;configuration&amp;#62;&lt;br /&gt;   &amp;#60;system.web&amp;#62;&lt;br /&gt;    .......&lt;br /&gt;     &amp;#60;authentication mode&amp;#61;&amp;#34;Forms&amp;#34;&amp;#62;&lt;br /&gt;        &amp;#60;forms loginUrl&amp;#61;&amp;#34; .....&amp;#34;&amp;#62;&amp;#60;&amp;#47;forms&amp;#62;&lt;br /&gt;     &amp;#60;&amp;#47;authentication&amp;#62;&lt;br /&gt;    ......&lt;br /&gt;   &amp;#60;&amp;#47;system.web&amp;#62;&lt;br /&gt;   &amp;#60;location path&amp;#61;&amp;#34;....path...&amp;#34;&amp;#62;&lt;br /&gt;     &amp;#60;system.web&amp;#62;&lt;br /&gt;       &amp;#60;authorization&amp;#62;&lt;br /&gt;           &amp;#60;allow roles&amp;#61;&amp;#34;....Roles separated by coma.....&amp;#34;&amp;#47;&amp;#62;&lt;br /&gt;&amp;#9;&amp;#60;deny users&amp;#61;&amp;#34;&amp;#42;&amp;#34;&amp;#47;&amp;#62;&lt;br /&gt;       &amp;#60;&amp;#47;authorization&amp;#62;&lt;br /&gt;     &amp;#60;&amp;#47;system.web&amp;#62;&lt;br /&gt;   &amp;#60;&amp;#47;location&amp;#62;&lt;br /&gt;&amp;#60;&amp;#47;configuration&amp;#62;&lt;br /&gt;</description><author></author><pubDate>Thu, 14 Feb 2008 10:12:57 GMT</pubDate><guid isPermaLink="false">CREATED RELEASE: Blaze Security Release v1.0 (Feb 14, 2008) 20080214A</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/nbalagopal/Wiki/View.aspx?title=Home&amp;version=3</link><description>&lt;div class="wikidoc"&gt;
Implementing forms authentication in an ASP.NET is quite easy using cookies. A few entries in the web.config and a few lines of code and you're done. &lt;br /&gt;The problem hits you when you need to handle roles using the same mechanism.&lt;br /&gt; &lt;br /&gt;The SetAuthCookie and RedirectFromLoginPage methods provided by the forms authentication class do not provide a means to store additional user information in the cookie except for the username.&lt;br /&gt; &lt;br /&gt;The solution provided here allows you to leverage the capability of cookies to store other user data where in you can store the roles of the user separated by coma.&lt;br /&gt;
&lt;/div&gt;</description><author>nbalagopal</author><pubDate>Thu, 14 Feb 2008 09:52:03 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080214A</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/nbalagopal/Wiki/View.aspx?title=Home&amp;version=2</link><description>&lt;div class="wikidoc"&gt;
Making role management in ASP.NET forms authentication easier.&lt;br /&gt; &lt;br /&gt;Implementing forms authentication in an ASP.NET is quite easy using cookies. A few entries in the web.config and a few lines of code and you're done. &lt;br /&gt;The problem hits you when you need to handle roles using the same mechanism.&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>nbalagopal</author><pubDate>Tue, 12 Feb 2008 10:28:48 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080212A</guid></item></channel></rss>