<?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:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://darioquintana.com.ar/blogging/wp-atom.php">
	<title type="text">Dario Quintana</title>
	<subtitle type="text">at blogging</subtitle>

	<updated>2012-04-30T07:05:48Z</updated>

	<link rel="alternate" type="text/html" href="http://darioquintana.com.ar/blogging" />
	<id>http://darioquintana.com.ar/blogging/feed/atom/</id>
	

	<generator uri="http://wordpress.org/" version="3.3.2">WordPress</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/DarioQuintana" /><feedburner:info uri="darioquintana" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[How To: Configure Access Control Service on Windows Azure]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/O5V1ni10nOI/" />
		<id>http://darioquintana.com.ar/blogging/?p=229</id>
		<updated>2012-04-30T07:05:48Z</updated>
		<published>2012-04-30T05:31:22Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="Access Control Service" /><category scheme="http://darioquintana.com.ar/blogging" term="Federated Identity" /><category scheme="http://darioquintana.com.ar/blogging" term="Windows Azure" /><category scheme="http://darioquintana.com.ar/blogging" term="Windows Identity Foundation" /><category scheme="http://darioquintana.com.ar/blogging" term="WIF" />		<summary type="html"><![CDATA[Credits <p align="justify">First of all, credits to those who helped me in the process of understanding of Federated Identity on .Net. Follow them up on twitter, they are cool people </p> <p><a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image12.png"></a></p> <p><a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image13.png"></a></p> <p><a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image14.png"></a></p> <p>And thanks to the <a href="http://altnethispano.org/Inicio.aspx">AltNet Hispano</a> community for those awesome sessions! </p> <p>Gracias!</p> Before to begin <p [...]]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2012/04/30/how-to-configure-access-control-service-on-windows-azure/">&lt;h1&gt;Credits&lt;/h1&gt;
&lt;p align="justify"&gt;First of all, credits to those who helped me in the process of understanding of Federated Identity on .Net. Follow them up on twitter, they are cool people &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Guiño" src="http://darioquintana.com.ar/blogging/wp-content/uploads/wlEmoticon-winkingsmile2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image12.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb11.png" width="240" height="57" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image13.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb12.png" width="240" height="57" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image14.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb13.png" width="240" height="49" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And thanks to the &lt;a href="http://altnethispano.org/Inicio.aspx"&gt;AltNet Hispano&lt;/a&gt; community for those awesome sessions! &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Gracias!&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Before to begin&lt;/h1&gt;
&lt;p align="justify"&gt;This how-to is designed for .Net developers. Since this is a how-to, for more background information you should visit and read the resources listed below. Would be useful for you if you get along with concepts like &lt;strong&gt;Federated Identity &lt;/strong&gt;and &lt;strong&gt;Claim-based architecture&lt;/strong&gt;.&lt;/p&gt;
&lt;h1&gt;Requirements to begin this how-to&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;An active Windows Azure account. There is a free trial for 3 months! This may work &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Sonrisa" src="http://darioquintana.com.ar/blogging/wp-content/uploads/wlEmoticon-smile1.png" /&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=17331"&gt;Windows Identity Foundation libs installed&lt;/a&gt;. This is the WIF runtime, you’ll need it for deployment. &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=4451"&gt;Windows Identity Foundation SDK&lt;/a&gt;. This are tools for your Visual Studio 2010, you need it just for development. &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;The gang&lt;/h1&gt;
&lt;p&gt;Now a brief presentation to the participants on this post.&lt;/p&gt;
&lt;h2&gt;Federated identity&lt;/h2&gt;
&lt;p align="justify"&gt;FI is the capability of trusting and delegating the authentication of an application into another a third party application. Oh, wait, but how is that secure? Well, is more secure and reliable than you can imaging. &lt;/p&gt;
&lt;p align="justify"&gt;The thing is, today companies are growing and sometimes integrating with each other; services are getting along and more often we fall into the requirements of integrate services.&lt;/p&gt;
&lt;p align="justify"&gt;In .Net is quite easy implement an application that authenticate against several Identity provider. The name of the architecture to achieve this is called: &lt;a href="http://msdn.microsoft.com/en-us/library/ff359108.aspx"&gt;Claim-based architecture&lt;/a&gt;.&lt;/p&gt;
&lt;p align="justify"&gt;And the answer in .Net to get this done is &lt;a href="http://msdn.microsoft.com/en-us/security/aa570351"&gt;Windows Identity Foundation&lt;/a&gt; (WIF).&lt;/p&gt;
&lt;h1 align="justify"&gt;Claims&lt;/h1&gt;
&lt;p align="justify"&gt;Claims are security information contained in security tokens issued by an identity provider. This information represents the identity of the client, i.e. Email, User Name, Name, Roles, etc. &lt;/p&gt;
&lt;p align="justify"&gt;The basic scenario for a claim base architecture is&lt;/p&gt;
&lt;p align="justify"&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image15.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb14.png" width="640" height="471" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="justify"&gt;Note that is the simplest scenario, ACS is not part of it, yet. The application knows where to get the authentication for this user, and there is just one identity provider, could be Gmail, Facebook, Active Directory (in this case the issuer may be an ADFS), etc.&lt;/p&gt;
&lt;p align="justify"&gt;&amp;#160;&lt;/p&gt;
&lt;h2 align="justify"&gt;Windows Identity Foundation &lt;/h2&gt;
&lt;p align="justify"&gt;Microsoft create this layer of abstraction in order to facilitate the process of authentication through existents identity providers: Active Directory, Google, Facebook, Windows Live ID, etc. In .Net sense, WIF are just .Net assemblies that we need to reference in our .Net projects.&lt;/p&gt;
&lt;h2 align="justify"&gt;Access Control System&lt;/h2&gt;
&lt;p align="justify"&gt;&lt;a href="https://www.windowsazure.com/es-es/home/features/access-control/"&gt;Access Control System (ACS)&lt;/a&gt; is part of Windows Azure Active Directory. Is the nexus between our apps and all the identity providers (Google, Windows Live ID, etc.).&lt;/p&gt;
&lt;p align="justify"&gt;-Should I’ve an active &lt;strong&gt;Windows Azure &lt;/strong&gt;account to use it? -&lt;strong&gt;Yes&lt;/strong&gt;.&lt;/p&gt;
&lt;p align="justify"&gt;-In order to achieve Federated identity on .Net; Should I always need ACS ? &lt;strong&gt;–No&lt;/strong&gt;. We are using it here to let him care about all identity providers we trust, in a way we are centralizing this matter. Then all applications on a company, may trust in just one &lt;strong&gt;Federation Provider&lt;/strong&gt;: and this is our dear ACS. You always can build an application with WIF to authenticate the application against any supported identity provider (IDP).&lt;/p&gt;
&lt;h1 align="left"&gt;Resources about Federated Identity on .Net&lt;/h1&gt;
&lt;p align="justify"&gt;For more concepts I recommend these readings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div align="justify"&gt;&lt;a href="http://claimsid.codeplex.com/"&gt;http://claimsid.codeplex.com/&lt;/a&gt; here you will find an amazing ebook that explains in details this topic. Ebook format: &lt;a href="http://msdn.microsoft.com/en-us/library/ff423674.aspx"&gt;Msdn version&lt;/a&gt; or &lt;a href="http://download.microsoft.com/download/C/7/6/C7680C21-E148-4240-A8CA-4D810FD7B055/A%20Guide%20to%20Claims-based%20Identity.pdf"&gt;PDF&lt;/a&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div align="justify"&gt;Papper: &lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=2576"&gt;Claims-Based Identity for Windows&lt;/a&gt;. &lt;a href="http://download.microsoft.com/download/7/D/0/7D0B5166-6A8A-418A-ADDD-95EE9B046994/Claims-Based%20Identity%20for%20Windows.pdf"&gt;PDF&lt;/a&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 align="justify"&gt;Sample architecture&lt;/h1&gt;
&lt;p align="justify"&gt;This is an overview of the information flow; how the resource request and authentication happens.&lt;/p&gt;
&lt;p align="justify"&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image16.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb15.png" width="640" height="463" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1 align="left"&gt;Creating an Asp.Net Web Application&lt;/h1&gt;
&lt;p align="justify"&gt;This will be the application what decides to have the authentication process delegated into another party.&lt;/p&gt;
&lt;p align="justify"&gt;In Visual Studio, let’s create just an Empty Web Application. An empty application just focus in the ACS integration, but if you like, you can create and Asp.Net Web Application or an MVC one, is up to you.&lt;/p&gt;
&lt;p align="left"&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML1b8d071.png"&gt;&lt;img style="display: inline" title="SNAGHTML1b8d071" alt="SNAGHTML1b8d071" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML1b8d071_thumb.png" width="640" height="442" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt;After that, add to the project a new&lt;em&gt; Web Form&lt;/em&gt; page called ‘&lt;em&gt;Default.aspx’&lt;/em&gt;. And the project should looks like this&lt;/p&gt;
&lt;p align="left"&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image17.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb16.png" width="250" height="114" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt;&amp;#160;&lt;/p&gt;
&lt;h1&gt;Configuring Access Control System namespace&lt;/h1&gt;
&lt;p&gt;Now, let’s see best part of this post, configuring the ACS, which a straightforward process. And for this you should have an active Windows Azure account.&lt;/p&gt;
&lt;p&gt;In the Windows Azure panel select &lt;em&gt;Service Bus, Access Control &amp;amp; Caching –&amp;gt; Access Control –&amp;gt; New&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML1cd8992.png"&gt;&lt;img style="display: inline" title="SNAGHTML1cd8992" alt="SNAGHTML1cd8992" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML1cd8992_thumb.png" width="454" height="666" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="justify"&gt;Create a unique namespace where our service is going to be running. Select the Country/Region that fits to you, then select the active Subscription of your Windows Azure account.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image18.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb17.png" width="750" height="310" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Wait for you namespace to be in ‘Active’ status. Then select it, and click on the button Access Control Service&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML1d7aa7a.png"&gt;&lt;img style="display: inline" title="SNAGHTML1d7aa7a" alt="SNAGHTML1d7aa7a" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML1d7aa7a_thumb.png" width="570" height="331" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Everything related to the Access Control Service for our namespace is here&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML1dba665.png"&gt;&lt;img style="display: inline" title="SNAGHTML1dba665" alt="SNAGHTML1dba665" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML1dba665_thumb.png" width="640" height="427" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Click on the left menu: &lt;em&gt;Identity Providers&lt;/em&gt;. This is the part we configure the Identity Providers. By Default we have already configured Windows Live ID. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML1e15d36.png"&gt;&lt;img style="display: inline" title="SNAGHTML1e15d36" alt="SNAGHTML1e15d36" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML1e15d36_thumb.png" width="753" height="409" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To add i.e. Google to the list, and also login with our Google accounts. Click on &lt;em&gt;Add&lt;/em&gt;. Then click on &lt;em&gt;Next&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image19.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb18.png" width="460" height="306" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In this screen let everything by default, and click on &lt;em&gt;Save&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image20.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb19.png" width="499" height="336" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image21.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb20.png" width="535" height="140" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Done, now our Federation provider support Google and Windows Live ID for login. The next step is configure the Relying Party applications (this may be our web application).&lt;/p&gt;
&lt;p&gt;Click on the left menu &lt;em&gt;Relying party applications&lt;/em&gt;, and then click on &lt;em&gt;Add&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image22.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb21.png" width="515" height="585" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="justify"&gt;Give it a &lt;em&gt;Name&lt;/em&gt;, a friendly one. Then add the &lt;em&gt;Realm&lt;/em&gt; and &lt;em&gt;Return URL&lt;/em&gt; to &lt;em&gt;&lt;a href="http://localhost:52000/"&gt;http://localhost:52000/&lt;/a&gt;. O&lt;/em&gt;ur sample web app is running under a development environment, that’s why the urls are set to localhost with the particular port. This may change in staging or production environments.&lt;/p&gt;
&lt;p align="justify"&gt;Then click &lt;em&gt;Save&lt;/em&gt;.&lt;/p&gt;
&lt;p align="justify"&gt;Now on the left menu, click on &lt;em&gt;Rule groups &lt;/em&gt;and also click in the Rule group created by default, in our case is called &lt;em&gt;Default Rule Group for Hello all of you&lt;/em&gt;.&lt;/p&gt;
&lt;p align="justify"&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image23.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb22.png" width="515" height="231" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt;You will see that, so far none rules were created, and a message like this should shown. Click on &lt;em&gt;Generate&lt;/em&gt;.&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image24.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb23.png" width="674" height="113" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt;Click on &lt;em&gt;Generate&lt;/em&gt;.&lt;/p&gt;
&lt;p align="justify"&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image25.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb24.png" width="254" height="201" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="justify"&gt;And the result will be four claim rules we’ll receive from our identity providers.&lt;/p&gt;
&lt;p align="justify"&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image26.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb25.png" width="739" height="184" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;h1&gt;Integrating the Federation Provider with Relaying Party&lt;/h1&gt;
&lt;p&gt;It’s time to integrate both ends, the ACS and our application.&lt;/p&gt;
&lt;p&gt;Click in &lt;em&gt;Application Integration &lt;/em&gt;and copy the url of the Federation Metadata file.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image27.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb26.png" width="640" height="396" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If Windows Identity Foundation SDK was installed correctly, by right-clicking the .Net project and selecting &lt;em&gt;“Add STS reference…”&lt;/em&gt; we start a wizard to configure the integration. If you haven’t yet, this is the moment.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image28.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb27.png" width="452" height="264" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As we are running the Web Application in our development machine, then the url is &lt;em&gt;http://localhost:52000/&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML7052f3e.png"&gt;&lt;img style="display: inline" title="SNAGHTML7052f3e" alt="SNAGHTML7052f3e" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML7052f3e_thumb.png" width="650" height="490" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A warning will be displayed, because we are not using our application with HTTPS, but is Ok for this sample application. Just click on Yes (Si).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML7079fad.png"&gt;&lt;img style="display: inline" title="SNAGHTML7079fad" alt="SNAGHTML7079fad" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML7079fad_thumb.png" width="473" height="171" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Using the url of Federation Metadata file, we paste it here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML708defd.png"&gt;&lt;img style="display: inline" title="SNAGHTML708defd" alt="SNAGHTML708defd" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML708defd_thumb.png" width="650" height="490" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML70a24d3.png"&gt;&lt;img style="display: inline" title="SNAGHTML70a24d3" alt="SNAGHTML70a24d3" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML70a24d3_thumb.png" width="650" height="490" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML70a7237.png"&gt;&lt;img style="display: inline" title="SNAGHTML70a7237" alt="SNAGHTML70a7237" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML70a7237_thumb.png" width="650" height="490" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML70aac98.png"&gt;&lt;img style="display: inline" title="SNAGHTML70aac98" alt="SNAGHTML70aac98" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML70aac98_thumb.png" width="650" height="490" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML70b2ba6.png"&gt;&lt;img style="display: inline" title="SNAGHTML70b2ba6" alt="SNAGHTML70b2ba6" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML70b2ba6_thumb.png" width="650" height="490" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After the integration, the tool will modify the project.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image29.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb28.png" width="571" height="319" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The web.config has suffer some changes. But we still need to add this line into system.web:&amp;#160; &lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 12.8pt"&gt;&lt;em&gt;&amp;lt;&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 12.8pt"&gt;&lt;em&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;httpRuntime&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;requestValidationMode&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&amp;quot;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;2.0&lt;/font&gt;&lt;/span&gt;&amp;quot;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 12.8pt" color="#0000ff"&gt;&lt;em&gt;&lt;span style="color: "&gt;&lt;/span&gt;&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image30.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb29.png" width="498" height="181" /&gt;&lt;/a&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 12.8pt"&gt;&lt;em&gt;&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;To have an interesting interaction, let’s see if the claim are coming from the identity providers. To achieve this add as a reference the assembly &lt;em&gt;Microsoft.IdentityModel&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image31.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb30.png" width="239" height="114" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the Load page event, in the &lt;em&gt;Default.aspx&lt;/em&gt; code behind, write this code to iterate through the claims received from the issuer&lt;/p&gt;
&lt;pre style="line-height: normal; font-family: ; background: white; color: "&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 12.8pt"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 12.8pt"&gt; System;
&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;using&lt;/font&gt;&lt;/span&gt; System.Web.UI;
&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;using&lt;/font&gt;&lt;/span&gt; Microsoft.IdentityModel.Claims;
&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;using&lt;/font&gt;&lt;/span&gt; System.Linq;
&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;namespace&lt;/font&gt;&lt;/span&gt; HelloAllOfYouQu
{
	&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;partial&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;class&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Default&lt;/font&gt;&lt;/span&gt; : &lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Page&lt;/font&gt;&lt;/span&gt;
	{
		&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;protected&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt; Page_Load(&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;object&lt;/font&gt;&lt;/span&gt; sender, &lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;EventArgs&lt;/font&gt;&lt;/span&gt; e)
		{
			&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt; claims = User.Identity &lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;as&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;ClaimsIdentity&lt;/font&gt;&lt;/span&gt;;

			claims
				.Claims
				.ToList()
				.ForEach(c =&amp;gt; Response.Write(&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;br&amp;gt;Type: &amp;quot;&lt;/font&gt;&lt;/span&gt; + c.ClaimType + &lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot; ; Value: &amp;quot;&lt;/font&gt;&lt;/span&gt; + c.Value));
		}
	}
}&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;h1&gt;Source code &lt;/h1&gt;
&lt;p&gt;In case you need it, here you’ve the final application sample:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/darioquintana/src/tree/master/Azure/HelloAllOfYouQu"&gt;https://github.com/darioquintana/src/tree/master/Azure/HelloAllOfYouQu&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Running the application &lt;/h1&gt;
&lt;p&gt;It’s time to try our sample. In Visual Studio, press F5 to run the web application. Since we are not logged in, the ACS let us choose between Windos Live ID or Google. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML2221c51.png"&gt;&lt;img style="display: inline" title="SNAGHTML2221c51" alt="SNAGHTML2221c51" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML2221c51_thumb.png" width="552" height="539" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I’ve select the Google account, so the ACS has redirected to the Google login page.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML22e44f6.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SNAGHTML22e44f6" border="0" alt="SNAGHTML22e44f6" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML22e44f6_thumb.png" width="896" height="537" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After the login, I’ve to grant permission to &lt;em&gt;helloallofyouqu.accesscontrol.windows.net&lt;/em&gt; to access to my Google information.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image32.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb31.png" width="840" height="256" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And this is it! Now we are authenticated, and we can see in the default page the claims that we got from Google.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML24074ae.png"&gt;&lt;img style="display: inline" title="SNAGHTML24074ae" alt="SNAGHTML24074ae" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML24074ae_thumb.png" width="774" height="228" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Conclusion &lt;/h1&gt;
&lt;p&gt;We created a web application delegating the authentication process to Windows Live ID or Google. We used Access Control Service from Azure, to manage the identity providers allowed by the application.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;
&lt;p&gt;@darioquintana&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/H3XftkKtWErbPIagYM8yO314Zvw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/H3XftkKtWErbPIagYM8yO314Zvw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/H3XftkKtWErbPIagYM8yO314Zvw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/H3XftkKtWErbPIagYM8yO314Zvw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/O5V1ni10nOI" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2012/04/30/how-to-configure-access-control-service-on-windows-azure/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2012/04/30/how-to-configure-access-control-service-on-windows-azure/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2012/04/30/how-to-configure-access-control-service-on-windows-azure/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[Installing Windows 8 Consumer Preview with VMWare Workstation 8]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/MYiL-Uaw_KQ/" />
		<id>http://darioquintana.com.ar/blogging/?p=129</id>
		<updated>2012-04-28T12:06:54Z</updated>
		<published>2012-04-28T00:06:34Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="VMWare" /><category scheme="http://darioquintana.com.ar/blogging" term="Windows 8" />		<summary type="html"><![CDATA[<p>All 8! </p> <p>Ok, serious here. The thing is, VMWare Workstation has no explicit support for Windows 8. The last version of Windows 8, for the moment, is the Consumer Preview that you can download for free from the Microsoft site, here: <a href="http://windows.microsoft.com/en-US/windows-8/iso">http://windows.microsoft.com/en-US/windows-8/iso</a></p> <p>If you’re wanting to install Windows 8 into a Virtual Machine [...]]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2012/04/27/installing-windows-8-consumer-preview-with-vmware-workstation-8/">&lt;p&gt;All 8! &lt;img class="wlEmoticon wlEmoticon-smilewithtongueout" style="border-style: none;" src="http://darioquintana.com.ar/blogging/wp-content/uploads/wlEmoticon-smilewithtongueout.png" alt="Lengua fuera" /&gt;&lt;/p&gt;
&lt;p&gt;Ok, serious here. The thing is, VMWare Workstation has no explicit support for Windows 8. The last version of Windows 8, for the moment, is the Consumer Preview that you can download for free from the Microsoft site, here: &lt;a href="http://windows.microsoft.com/en-US/windows-8/iso"&gt;http://windows.microsoft.com/en-US/windows-8/iso&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you’re wanting to install Windows 8 into a Virtual Machine this is your choice, there are another choices.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image8.png"&gt;&lt;img style="display: inline;" title="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb7.png" alt="image" width="578" height="197" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Save the product key you will need it later.&lt;/p&gt;
&lt;p&gt;Before we get started, make sure to 1) add you current Windows user into the group __wmware__ 2) Set your VMWare Workstation to compatibility with Windows XP Sp3, and finally 3) Run your VMWare Workstation as an Administrator.&lt;/p&gt;
&lt;p&gt;All these steps are covered here &lt;a href="http://blogs.vmware.com/workstation/2011/09/vmware-workstation-8-running-windows-8.html"&gt;http://blogs.vmware.com/workstation/2011/09/vmware-workstation-8-running-windows-8.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once you have done everything we said, you enter to the wizard in order to create a new Virtual Machine to install your Windows 8, and you go for “Custom” installation, right this way:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML25368ad.png"&gt;&lt;img style="display: inline;" title="SNAGHTML25368ad" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML25368ad_thumb.png" alt="SNAGHTML25368ad" width="442" height="401" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then continue till this screen, and make sure you choose “I will install the system operating later”, otherwise we are going to have problems in the future.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML254b7f5.png"&gt;&lt;img style="display: inline;" title="SNAGHTML254b7f5" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML254b7f5_thumb.png" alt="SNAGHTML254b7f5" width="442" height="401" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the next steps, select the installation just like you’re going to install a Windows 7, but you’re not –just in case comment-.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML25cddad.png"&gt;&lt;img style="display: inline;" title="SNAGHTML25cddad" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML25cddad_thumb.png" alt="SNAGHTML25cddad" width="442" height="401" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then continue, and let the force guide you till the last step, then press in the button “Customize Hardware”.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML25f749f.png"&gt;&lt;img style="display: inline;" title="SNAGHTML25f749f" src="http://darioquintana.com.ar/blogging/wp-content/uploads/SNAGHTML25f749f_thumb.png" alt="SNAGHTML25f749f" width="442" height="401" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then locate and select your Windows 8 CP iso file, and then continue.&lt;/p&gt;
&lt;p&gt;That’s it. There aren’t more tricks in the next steps.&lt;/p&gt;
&lt;p&gt;And the result is&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image6.png"&gt;&lt;img style="display: inline;" title="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb5.png" alt="image" width="640" height="433" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/K8Q11r2cdMSlU-ZbsViGxre_lBY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K8Q11r2cdMSlU-ZbsViGxre_lBY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/K8Q11r2cdMSlU-ZbsViGxre_lBY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K8Q11r2cdMSlU-ZbsViGxre_lBY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/MYiL-Uaw_KQ" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2012/04/27/installing-windows-8-consumer-preview-with-vmware-workstation-8/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2012/04/27/installing-windows-8-consumer-preview-with-vmware-workstation-8/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2012/04/27/installing-windows-8-consumer-preview-with-vmware-workstation-8/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[Authorizable content with Razor]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/8DiSef-ZhJM/" />
		<id>http://darioquintana.com.ar/blogging/?p=113</id>
		<updated>2012-04-17T16:15:19Z</updated>
		<published>2012-04-17T16:15:19Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="Uncategorized" />		<summary type="html"><![CDATA[<p>Easy way in Asp.net MVC with Razor, to solve this problem: </p> <p>“I’ve a piece of code in the view, but I want to render it, just if you’re part of a particular role.”</p> <p align="justify">Lucky us, with razor and his mechanism to easily extends Html Helpers, we can allow that some part of the [...]]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2012/04/17/authorizable-content-with-razor/">&lt;p&gt;Easy way in Asp.net MVC with Razor, to solve this problem: &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;“I’ve a piece of code in the view, but I want to render it, just if you’re part of a particular role.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p align="justify"&gt;Lucky us, with razor and his mechanism to easily extends Html Helpers, we can allow that some part of the code required authorization. Let’s see an example of how to get there. &lt;/p&gt;
&lt;h2&gt;Using it&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image3.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb2.png" width="550" height="112" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The html text will be render only if you’re part of the role Administrator. In this example we’re using just one role: Administrator, you can enumerate more than one role separated by comma, have a look in the source we are using &lt;font color="#0000ff" face="Consolas"&gt;params&lt;/font&gt;.&lt;/p&gt;
&lt;h2&gt;The code &lt;/h2&gt;
&lt;p&gt;This method, as every html helpers existent in the world, is part of a static class. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image4.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb3.png" width="653" height="326" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Looking for more? Sorry for disappoint you!&lt;/p&gt;
&lt;h2&gt;Important&lt;/h2&gt;
&lt;p align="justify"&gt;This kind of authorization requires that you’ll set properly the authorization on server side, this means, i.e. if you hide a link on the client-side, you also have to set the Authorize attribute on your controller action to avoid security leaks.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fEarOvJhCEGFkfX38Kpf1nE6ml8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fEarOvJhCEGFkfX38Kpf1nE6ml8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fEarOvJhCEGFkfX38Kpf1nE6ml8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fEarOvJhCEGFkfX38Kpf1nE6ml8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/8DiSef-ZhJM" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2012/04/17/authorizable-content-with-razor/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2012/04/17/authorizable-content-with-razor/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2012/04/17/authorizable-content-with-razor/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[NHibernate Validator on GitHub]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/BbW9RfPmtzU/" />
		<id>http://darioquintana.com.ar/blogging/?p=104</id>
		<updated>2012-04-17T15:49:04Z</updated>
		<published>2012-04-17T15:47:00Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Validator" />		<summary type="html"><![CDATA[<p><a href="http://darioquintana.com.ar/blogging/wp-content/uploads/MG_0914.jpg"></a></p> <p>Well, I just can said that: Finally! Now you can find NHibernate Validator source code here:</p> <p><a href="https://github.com/darioquintana/NHibernate-Validator">https://github.com/darioquintana/NHibernate-Validator</a></p> <p>The source code is ready to use with the last GA version of NHibernate 3.2.0.</p>]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2012/04/17/nhibernate-validator-on-github/">&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/MG_0914.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="MG_0914" border="0" alt="MG_0914" src="http://darioquintana.com.ar/blogging/wp-content/uploads/MG_0914_thumb.jpg" width="572" height="366" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Well, I just can said that: Finally! Now you can find NHibernate Validator source code here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/darioquintana/NHibernate-Validator"&gt;https://github.com/darioquintana/NHibernate-Validator&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The source code is ready to use with the last GA version of NHibernate 3.2.0.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zjiU_0bV6IKltmMw-MND3qcDpEY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zjiU_0bV6IKltmMw-MND3qcDpEY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zjiU_0bV6IKltmMw-MND3qcDpEY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zjiU_0bV6IKltmMw-MND3qcDpEY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/BbW9RfPmtzU" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2012/04/17/nhibernate-validator-on-github/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2012/04/17/nhibernate-validator-on-github/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2012/04/17/nhibernate-validator-on-github/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[NHibernate Validator 1.3.1 GA]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/yOLw0riJu2Q/" />
		<id>http://darioquintana.com.ar/blogging/2011/04/18/nhibernate-validator-1-3-1-ga/</id>
		<updated>2011-04-18T04:31:55Z</updated>
		<published>2011-04-18T04:31:55Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="Uncategorized" />		<summary type="html"><![CDATA[<p>Hello friends, here is the new release of NHibernate Validator. There are 2 improvements in this release since NHibernate 1.3.0 GA, call it a service pack .</p> <p>First of all, Log4net is not longer needed as a dependency. What this means: tecnically the NHibernate.Validator.dll doesn’t need the library log4net.dll. If you have Log4net in your [...]]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2011/04/18/nhibernate-validator-1-3-1-ga/">&lt;p&gt;Hello friends, here is the new release of NHibernate Validator. There are 2 improvements in this release since NHibernate 1.3.0 GA, call it a service pack &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Guiño" src="http://darioquintana.com.ar/blogging/wp-content/uploads/wlEmoticon-winkingsmile.png" /&gt;.&lt;/p&gt;
&lt;p&gt;First of all, &lt;strong&gt;Log4net is not longer needed as a dependency&lt;/strong&gt;. What this means: tecnically the NHibernate.Validator.dll doesn’t need the library log4net.dll. If you have Log4net in your project NHibernate Validator will detect it and will use it. How cool is that?. This was achieve it easily, using a NHibernate feature: NHibernate.IInternalLogger.&lt;/p&gt;
&lt;p&gt;This later improvement has to be with the second feature: &lt;strong&gt;support for NuGet&lt;/strong&gt;. Yes, now you can install NHibernate Validator into your project using &lt;a href="http://nuget.org/"&gt;NuGet&lt;/a&gt; with just one command into the console.&lt;/p&gt;
&lt;p&gt;Here is the page for the nuget package for NHibernate Validator: &lt;a href="http://nuget.org/List/Packages/NHibernate.Validator"&gt;Go here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb.png" width="620" height="492" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Where to get NHibernate Validator 1.3.1 GA ?&lt;/p&gt;
&lt;p&gt;Download binaries and source from Sourceforge&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sourceforge.net/projects/nhcontrib/files/NHibernate.Validator/1.3.1%20GA/?"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image1.png" width="325" height="82" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Download binaries with NuGet&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb1.png" width="620" height="85" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xtXU789le6jWKbOaSbWN75tfvco/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xtXU789le6jWKbOaSbWN75tfvco/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xtXU789le6jWKbOaSbWN75tfvco/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xtXU789le6jWKbOaSbWN75tfvco/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/yOLw0riJu2Q" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2011/04/18/nhibernate-validator-1-3-1-ga/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2011/04/18/nhibernate-validator-1-3-1-ga/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2011/04/18/nhibernate-validator-1-3-1-ga/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[NHibernate Validator 1.2 Beta3 released]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/6iTqfLSvCZU/" />
		<id>http://darioquintana.com.ar/blogging/?p=88</id>
		<updated>2009-10-26T16:24:08Z</updated>
		<published>2009-10-26T16:24:08Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="NHibernate" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Contrib" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Validator" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate Validator" />		<summary type="html"><![CDATA[<p></p> <p>Download NHibernate Validator 1.2 beta3 with sources, binaries and example here <a href="https://sourceforge.net/projects/nhcontrib/files">here</a></p> <p>For use it with NHibernate 2.1 GA.</p> <p>For examples and documentation see the serie of blog posts of Fabio Maulo about NHibernate Validator <a href="http://fabiomaulo.blogspot.com/search/label/Validator">here</a></p>]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/10/26/nhibernate-validator-1-2-beta3-released/">&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/NHV-logo-white-background.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Download NHibernate Validator 1.2 beta3 with sources, binaries and example here &lt;a href="https://sourceforge.net/projects/nhcontrib/files"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For use it with NHibernate 2.1 GA.&lt;/p&gt;
&lt;p&gt;For examples and documentation see the serie of blog posts of Fabio Maulo about NHibernate Validator &lt;a href="http://fabiomaulo.blogspot.com/search/label/Validator"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/TKV4tK_l_LkP0RLwNKjDdf2sUKY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TKV4tK_l_LkP0RLwNKjDdf2sUKY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/TKV4tK_l_LkP0RLwNKjDdf2sUKY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TKV4tK_l_LkP0RLwNKjDdf2sUKY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/6iTqfLSvCZU" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/10/26/nhibernate-validator-1-2-beta3-released/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/10/26/nhibernate-validator-1-2-beta3-released/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/10/26/nhibernate-validator-1-2-beta3-released/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[NHibernate Validator 1.2 Beta2 released]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/rhsmBaEXjJI/" />
		<id>http://darioquintana.com.ar/blogging/?p=85</id>
		<updated>2009-10-10T18:13:05Z</updated>
		<published>2009-10-10T18:13:05Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="NHibernate" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Validator" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate Validator" />		<summary type="html"><![CDATA[<p></p> <p>Download NHibernate Validator 1.2 beta2 with sources, binaries and example here <a href="https://sourceforge.net/projects/nhcontrib/files">here</a></p> <p>For use it with NHibernate 2.1 GA.</p> <p>Enjoy it !</p>]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/10/10/nhibernate-validator-1-2-beta2-released/">&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/NHV-logo-white-background.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Download NHibernate Validator 1.2 beta2 with sources, binaries and example here &lt;a href="https://sourceforge.net/projects/nhcontrib/files"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For use it with NHibernate 2.1 GA.&lt;/p&gt;
&lt;p&gt;Enjoy it !&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dTYIMNLHY6H1X1mjorMQ40tUQy8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dTYIMNLHY6H1X1mjorMQ40tUQy8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dTYIMNLHY6H1X1mjorMQ40tUQy8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dTYIMNLHY6H1X1mjorMQ40tUQy8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/rhsmBaEXjJI" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/10/10/nhibernate-validator-1-2-beta2-released/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/10/10/nhibernate-validator-1-2-beta2-released/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/10/10/nhibernate-validator-1-2-beta2-released/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[jqGrid + Linq + Asp.Net MVC example]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/dPvtS9P5DEE/" />
		<id>http://darioquintana.com.ar/blogging/?p=76</id>
		<updated>2009-08-15T18:20:07Z</updated>
		<published>2009-08-15T18:20:07Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="Asp.Net MVC" /><category scheme="http://darioquintana.com.ar/blogging" term="Asp.Net" /><category scheme="http://darioquintana.com.ar/blogging" term="jqGrid" /><category scheme="http://darioquintana.com.ar/blogging" term="jQuery" /><category scheme="http://darioquintana.com.ar/blogging" term="Linq" />		<summary type="html"><![CDATA[<p>For those who want get working these tools/frameworks and achieve a grid like this:</p> <p></p> <p>Okey, if you like that, this is the stuff used to get it work:</p> System.Linq.Dynamic. <a href="http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx">More&#8230;</a> jqGrid. <a href="http://www.trirand.com/blog/">More&#8230;</a> and for more Online Demos go <a href="http://www.trirand.com/jqgrid/jqgrid.html">here&#8230;</a> Asp.Net MVC. <a href="http://www.asp.net/mvc/">More&#8230;</a> <p><a href="http://darioquintana.googlecode.com/files/jqGridMVC.Example.zip">Download the code example here.</a></p> <p>The application [...]]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/08/15/jqgrid-linq-asp-net-mvc-example/">&lt;p&gt;For those who want get working these tools/frameworks and achieve a grid like this:&lt;/p&gt;
&lt;p&gt;&lt;img class="aligncenter size-full wp-image-81" title="jqGridMVCExample" src="http://darioquintana.com.ar/blogging/wp-content/uploads/jqGridMVCExample.png" alt="jqGridMVCExample" width="523" height="499" /&gt;&lt;/p&gt;
&lt;p&gt;Okey, if you like that, this is the stuff used to get it work:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;System.Linq.Dynamic. &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx"&gt;More&amp;#8230;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;jqGrid. &lt;a href="http://www.trirand.com/blog/"&gt;More&amp;#8230;&lt;/a&gt; and for more Online Demos go &lt;a href="http://www.trirand.com/jqgrid/jqgrid.html"&gt;here&amp;#8230;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Asp.Net MVC. &lt;a href="http://www.asp.net/mvc/"&gt;More&amp;#8230;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://darioquintana.googlecode.com/files/jqGridMVC.Example.zip"&gt;Download the code example here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The application was based on the well known example from &lt;a href="http://www.haacked.com/archive/2009/04/14/using-jquery-grid-with-asp.net-mvc.aspx"&gt;haacked.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_4C2llYazx2EEbyToERHR7ByzC8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_4C2llYazx2EEbyToERHR7ByzC8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_4C2llYazx2EEbyToERHR7ByzC8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_4C2llYazx2EEbyToERHR7ByzC8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/dPvtS9P5DEE" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/08/15/jqgrid-linq-asp-net-mvc-example/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/08/15/jqgrid-linq-asp-net-mvc-example/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/08/15/jqgrid-linq-asp-net-mvc-example/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[Asp.net MVC: Testing a custom Authorize filters]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/FQ0aFzYniAc/" />
		<id>http://darioquintana.com.ar/blogging/?p=69</id>
		<updated>2009-05-23T23:42:35Z</updated>
		<published>2009-05-23T23:39:19Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="Asp.Net MVC" /><category scheme="http://darioquintana.com.ar/blogging" term="Testing" /><category scheme="http://darioquintana.com.ar/blogging" term="Web" />		<summary type="html"><![CDATA[<p>Asp.net MVC let you intercept the actions via a feature they call: Filters. Filters are just <a href="http://msdn.microsoft.com/en-us/library/system.attribute.aspx">attributes</a> that you decorate into actions and them allow to you make an stop before or after the action-methods are executed (also are filters to intercept code before/after the result is executed, errors are thrown, etc). There are [...]]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/05/23/aspnet-mvc-testing-a-custom-authorize-filters/">&lt;p&gt;Asp.net MVC let you intercept the actions via a feature they call: Filters. Filters are just &lt;a href="http://msdn.microsoft.com/en-us/library/system.attribute.aspx"&gt;attributes&lt;/a&gt; that you decorate into actions and them allow to you make an stop before or after the action-methods are executed (also are filters to intercept code before/after the result is executed, errors are thrown, etc). There are a few kind of Filter attributes, in the picture bellow into the blue square you&amp;#8217;ve what filters came supported out-of-the-box.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/Mvc-filters01.png" /&gt;&lt;/p&gt;
&lt;p&gt;Today we are going to talk about the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.authorizeattribute.aspx"&gt;AuthorizeAttribute&lt;/a&gt; and how to extend and test it. &lt;/p&gt;
&lt;p&gt;AuthorizeAttribute (from the Msdn):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Represents an attribute that is used to restrict access by callers to an action method.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This filter is the first to be called when the Controller Action Invoker try to run Action methods. You can set into the attribute which are the Users or Roles can execute an Action, if the User/Role doesn?t fulfill with what was established into the Action an &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.httpunauthorizedresult.aspx"&gt;Unauthorized Result&lt;/a&gt; is raised. Remember that exactly after the filter execution ended in a &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult.aspx"&gt;ActionResult&lt;/a&gt;, that result is executed.&lt;/p&gt;
&lt;p&gt;Now, let?s go to the hypothetical scenario that you need a custom authorization schema, that you need more than User/Role, or you just need neither of both, because your model is based on a Security &lt;strong&gt;Level&lt;/strong&gt;. So you don?t care about who is the guy? / or what role it has?, you just need the security level it has.&lt;/p&gt;
&lt;p&gt;With this scenario you can write a custom Authorize attribute:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/Mvc-filters02.png" /&gt; &lt;/p&gt;
&lt;p&gt;In this &lt;em&gt;CustomAuthorize&lt;/em&gt; attribute, we are doing first the well known authorization (which is, executing the code as is in the class base). When that authorization part passed, we go through our custom authorization part: we get the user from the Database (or whatever other source) and we check the security level. If it?s allowed to execute the action-method we end without setting the result. If it?s not, we set a &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.httpunauthorizedresult.aspx"&gt;HttpUnauthorizedResult&lt;/a&gt;. In the browser you will be redirected to the login page if you?re not allowed to execute that code.&lt;/p&gt;
&lt;p&gt;Now the problem is when you need to test the authorization. Actually you can do it with some mock and overriding some code.&lt;/p&gt;
&lt;p&gt;Another thing you?ve to know is that the object in charge of execute the actions is the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.controlleractioninvoker.aspx"&gt;ControllerActionInvoker&lt;/a&gt;. Then to invoke and action into your tests and see the result when the filters are invoked, we need to customize some, and override the method in charge of execute the result (the ActionResult), which is InvokeActionResult. Where is how should looks our method override:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/Mvc-filters03.png" /&gt; &lt;/p&gt;
&lt;p&gt;Assert is a class from a Unit Testing framework, in this case in the example is using the Unit Testing framework that came with Visual Studio because every user can run the tests without have ie: Resharper installed. This Assert is expecting that the Result from the filter/action execution is the same with the TResult (is a generic parameter declared into the class). So with this class, we can make an easy test to see if the result is authorized or unauthorized.&lt;/p&gt;
&lt;p&gt;Our test for authorized access, should be looking like this&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/Mvc-filters04.png" /&gt; &lt;/p&gt;
&lt;p&gt;First we are creating a new Controller, we mock stuff for authentication, and then using our custom action invoker to try to invoke the action using InvokeAction method (passing the Context and the Action name to be executed).&lt;/p&gt;
&lt;p&gt;We are using some extensions and helpers methods, i.e.: &lt;em&gt;SetFakeAuthenticatedContext&lt;/em&gt; is included into the example and there you?ll see which elements you need to mock when use Authorize filter-attributes.&lt;/p&gt;
&lt;p&gt;To understand what happened in this first test method:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Controller creation &lt;/li&gt;
&lt;li&gt;Mock authentication stuff using our user named:?pepe?. &lt;/li&gt;
&lt;li&gt;Using the custom invoker we launch the action ?PermisiveAction?. &lt;/li&gt;
&lt;li&gt;The CustomAuthorized filter is raised, it pass the authorization. &lt;/li&gt;
&lt;li&gt;The action is executed and return a ViewResult (doing return View() into the code). &lt;/li&gt;
&lt;li&gt;The Assertion is made, everything ok and the test pass. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;And now let?s see this another test&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/Mvc-filters05.png" /&gt; &lt;/p&gt;
&lt;p&gt;The difference with the previous one is in the step 4, 5 and 6. The action is not executed because the filter raise an HttpUnauthorizedResult. Download the example to understand better how to manage the testing of Authorization on Actions.&lt;/p&gt;
&lt;h2&gt;&lt;a href="http://darioquintana.googlecode.com/files/MvcAuthorize.zip"&gt;Download code example&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_myANfSWZZcqcgJ7sEaVt02Dt4E/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_myANfSWZZcqcgJ7sEaVt02Dt4E/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_myANfSWZZcqcgJ7sEaVt02Dt4E/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_myANfSWZZcqcgJ7sEaVt02Dt4E/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/FQ0aFzYniAc" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/05/23/aspnet-mvc-testing-a-custom-authorize-filters/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/05/23/aspnet-mvc-testing-a-custom-authorize-filters/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/05/23/aspnet-mvc-testing-a-custom-authorize-filters/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[NHibernate Validator Quickstart]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/ZwqGt5FTOnY/" />
		<id>http://darioquintana.com.ar/blogging/?p=68</id>
		<updated>2009-05-18T04:51:28Z</updated>
		<published>2009-05-18T04:51:28Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="Asp.Net MVC" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Validator" /><category scheme="http://darioquintana.com.ar/blogging" term="Quickstart" /><category scheme="http://darioquintana.com.ar/blogging" term="Web" />		<summary type="html"><![CDATA[<p></p> <p>The NHibernate Validator Team had prepared examples to you be able to use this validation framework in a easy way. With four examples we are covering the following topics:</p> 1) Winforms <p>In this example you will how you can easily integrate NHibernate Validator and some helper clases with System.Windows.Forms.</p> 2) NHibernate Integration <p>Trying to [...]]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/05/18/nhibernate-validator-quickstart/">&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/NHV-logo-white-background.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;The NHibernate Validator Team had prepared examples to you be able to use this validation framework in a easy way. With four examples we are covering the following topics:&lt;/p&gt;
&lt;h3&gt;1) Winforms&lt;/h3&gt;
&lt;p&gt;In this example you will how you can easily integrate NHibernate Validator and some helper clases with System.Windows.Forms.&lt;/p&gt;
&lt;h3&gt;2) NHibernate Integration&lt;/h3&gt;
&lt;p&gt;Trying to integrate NHibernate Validator with NHibernate? Not a problem. In this example you will how really get these 2 great frameworks working together. NHibernate Validator let you intercept Saves and Updates from NHibernate validating your entities before these changes take place. Note you have to create a database based on the configured connection string.&lt;/p&gt;
&lt;h3&gt;3) Asp.Net MVC&lt;/h3&gt;
&lt;p&gt;Asp.Net MVC has a cool way to add validation errors from model and display them all into the View. This example cover the easy integration between these frameworks. Note, you need Asp.Net MVC installed into your machine.&lt;a title="Download Asp.net MVC" href="http://www.asp.net/mvc/"&gt;Download Asp.net MVC&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;4) Entity Validator&lt;/h3&gt;
&lt;p&gt;Sometimes you need to validate a property which depends of another(s) property(ies). The most common example is when you have to validate a range of dates. This example cover this funcionality and show to us how to configurate it using attributes, xml and fluent.&lt;/p&gt;
&lt;h2&gt;&lt;a href="https://sourceforge.net/project/showfiles.php?group_id=216446&amp;amp;package_id=275108"&gt;Download it here&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BShANMwYkVoTjktk2GvRV7BMhfY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BShANMwYkVoTjktk2GvRV7BMhfY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BShANMwYkVoTjktk2GvRV7BMhfY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BShANMwYkVoTjktk2GvRV7BMhfY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/ZwqGt5FTOnY" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/05/18/nhibernate-validator-quickstart/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/05/18/nhibernate-validator-quickstart/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/05/18/nhibernate-validator-quickstart/</feedburner:origLink></entry>
	</feed>

