<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1521206372627229850</id><updated>2012-02-13T07:59:51.346-08:00</updated><category term='NHibernate'/><category term='DDD'/><category term='Federated Security'/><category term='T-SQL'/><category term='Development Workflow'/><category term='Tutorial'/><category term='WIF'/><category term='Talk'/><category term='Training Resources'/><category term='Career Advice'/><category term='Single Sign-on'/><title type='text'>my cup of [T]</title><subtitle type='html'>Posts, rants and any random thoughts about software development and technology in general.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://claudioasanchez.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://claudioasanchez.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Claudio Sanchez</name><uri>http://www.blogger.com/profile/04611561704063156872</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/-CfDBxJE5y3k/TVvnSVN0yEI/AAAAAAAADyU/8L7qqVLrM20/s220/Claudio.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1521206372627229850.post-8067362571686981522</id><published>2012-02-08T15:41:00.001-08:00</published><updated>2012-02-13T07:59:51.357-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Career Advice'/><title type='text'>How to get a job with Microsoft, Apple or Google</title><content type='html'>I recently read a very interesting article about how to get yourself noticed in the “Major Leagues” . The &lt;a href="http://www.businessinsider.com/9-reasons-your-current-resume-will-never-get-you-a-job-at-apple-or-google-2012-2?op=1" target="_blank"&gt;article&lt;/a&gt; is by Gayle Laakmann McDowell, who herself has worked at four of today’s big tech companies the likes of Apple, Google and Microsoft.&lt;br /&gt;Here is a &lt;strong&gt;short version&lt;/strong&gt; of the 9 Reasons.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Go to an elite school (or associate with one).  &lt;/li&gt;&lt;li&gt;Intern early, and relevant to your career (knowing how to flip burgers doesn’t make you a better coder).  &lt;/li&gt;&lt;li&gt;Major in something relevant.  &lt;/li&gt;&lt;li&gt;Community service means: do Tech work for free, not in a soup kitchen.  &lt;/li&gt;&lt;li&gt;Learn how to write (oops, that is why I could never land one of those &lt;img alt="Winking smile" class="wlEmoticon wlEmoticon-winkingsmile" src="http://lh5.ggpht.com/-AL8s095i7os/TzMIGmADbaI/AAAAAAAAD74/UUB4feewmAg/wlEmoticon-winkingsmile%25255B2%25255D.png?imgmax=800" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none;" /&gt;).  &lt;/li&gt;&lt;li&gt;Be a teacher’s pet. They write good recommendation letters.  &lt;/li&gt;&lt;li&gt;Be a generalist.  &lt;/li&gt;&lt;li&gt;Be an entrepreneur, innovate or deliver results.  &lt;/li&gt;&lt;li&gt;no one cares if you have a 4.0 GPA.&lt;/li&gt;&lt;/ul&gt;At the end of the day, make sure that whatever you do is transferable to the next step/job in your career.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1521206372627229850-8067362571686981522?l=claudioasanchez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claudioasanchez.blogspot.com/feeds/8067362571686981522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claudioasanchez.blogspot.com/2012/02/how-to-get-job-with-microsoft-apple-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/8067362571686981522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/8067362571686981522'/><link rel='alternate' type='text/html' href='http://claudioasanchez.blogspot.com/2012/02/how-to-get-job-with-microsoft-apple-or.html' title='How to get a job with Microsoft, Apple or Google'/><author><name>Claudio Sanchez</name><uri>http://www.blogger.com/profile/04611561704063156872</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/-CfDBxJE5y3k/TVvnSVN0yEI/AAAAAAAADyU/8L7qqVLrM20/s220/Claudio.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-AL8s095i7os/TzMIGmADbaI/AAAAAAAAD74/UUB4feewmAg/s72-c/wlEmoticon-winkingsmile%25255B2%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1521206372627229850.post-9219856394867385800</id><published>2011-12-30T09:37:00.001-08:00</published><updated>2011-12-30T09:37:12.791-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Training Resources'/><title type='text'>MSDN Training Courses</title><content type='html'>&lt;p&gt;Microsoft’s DPE Team has put together some great training courses available for download. It is always good to “sharpen the tools”, and this would be a great starting point for learning a new skill or sharpen the already developed one.&lt;/p&gt; &lt;p&gt;Some of the ones that caught my eye are: &lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/WP7MangoTrainingCourse"&gt;Windows Phone codenamed "Mango" Training Course&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/WAZPlatformTrainingCourse"&gt;Windows Azure Training Course&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp; Link to Training Courses: &lt;a title="http://msdn.microsoft.com/en-us/gg299335" href="http://msdn.microsoft.com/en-us/gg299335"&gt;http://msdn.microsoft.com/en-us/gg299335&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1521206372627229850-9219856394867385800?l=claudioasanchez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claudioasanchez.blogspot.com/feeds/9219856394867385800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claudioasanchez.blogspot.com/2011/12/msdn-training-courses.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/9219856394867385800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/9219856394867385800'/><link rel='alternate' type='text/html' href='http://claudioasanchez.blogspot.com/2011/12/msdn-training-courses.html' title='MSDN Training Courses'/><author><name>Claudio Sanchez</name><uri>http://www.blogger.com/profile/04611561704063156872</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/-CfDBxJE5y3k/TVvnSVN0yEI/AAAAAAAADyU/8L7qqVLrM20/s220/Claudio.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1521206372627229850.post-7507934817733225828</id><published>2011-12-21T09:29:00.001-08:00</published><updated>2011-12-21T09:29:18.175-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WIF'/><category scheme='http://www.blogger.com/atom/ns#' term='Federated Security'/><title type='text'>Windows Identity Foundation Training available</title><content type='html'>&lt;p&gt;[Federated] Security is no easy thing, let’s just state that out of the gate. That is why our Federated Security guru&amp;nbsp; &lt;a href="http://www.leastprivilege.com/" target="_blank"&gt;Dominick Baier&lt;/a&gt; has put together a two-day course. You can get some more details&amp;nbsp; over &lt;a href="http://www.leastprivilege.com/NeedWIFTraining.aspx" target="_blank"&gt;here&lt;/a&gt;. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1521206372627229850-7507934817733225828?l=claudioasanchez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claudioasanchez.blogspot.com/feeds/7507934817733225828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claudioasanchez.blogspot.com/2011/12/windows-identity-foundation-training.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/7507934817733225828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/7507934817733225828'/><link rel='alternate' type='text/html' href='http://claudioasanchez.blogspot.com/2011/12/windows-identity-foundation-training.html' title='Windows Identity Foundation Training available'/><author><name>Claudio Sanchez</name><uri>http://www.blogger.com/profile/04611561704063156872</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/-CfDBxJE5y3k/TVvnSVN0yEI/AAAAAAAADyU/8L7qqVLrM20/s220/Claudio.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1521206372627229850.post-9218344956839016057</id><published>2011-12-19T08:12:00.001-08:00</published><updated>2012-02-09T10:19:45.797-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='WIF'/><category scheme='http://www.blogger.com/atom/ns#' term='Single Sign-on'/><category scheme='http://www.blogger.com/atom/ns#' term='Federated Security'/><title type='text'>Walk-through of provisioning Identity Server v1.0</title><content type='html'>&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;h2&gt;Introduction&lt;/h2&gt;If you have the need to use your own Identity Provider, and want to go with something light (&lt;em&gt;i.e.: not ADFS&lt;/em&gt;), Thinktecture’s Identity Server is your product.&amp;nbsp; I have been using it for the last couple of months and I love it!! I actually added a service layer over it to enable my RP to provision users in the Identity Server (yes, I know that this is contrary to the general concept of outsourcing Identity Management, but in my scenario, trust me, it makes sense). &lt;br /&gt;From the &lt;a href="http://identityserver.codeplex.com/" target="_blank"&gt;CodePlex&lt;/a&gt; site:&lt;br /&gt;&lt;blockquote&gt;Thinktecture IdentityServer is an open source security token service based on Microsoft .NET, ASP.NET MVC, WCF and WIF.&lt;br /&gt;&lt;b&gt;High level features&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Multiple protocols support (WS-Trust, WS-Federation, OAuth2, WRAP, JSNotify, HTTP GET)  &lt;/li&gt;&lt;li&gt;Multiple token support (SAML 1.1/2.0, SWT)  &lt;/li&gt;&lt;li&gt;Out of the box integration with ASP.NET membership, roles and profile  &lt;/li&gt;&lt;li&gt;Support for username/password and client certificates authentication  &lt;/li&gt;&lt;li&gt;Support for WS-Federation metadata  &lt;/li&gt;&lt;li&gt;Support for WS-Trust identity delegation  &lt;/li&gt;&lt;li&gt;Extensibility points to customize configuration and user management handling&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;h2&gt;Setup&lt;/h2&gt;&lt;div&gt;&lt;span style="color: red; font-weight: bold;"&gt;UPDATE: &lt;/span&gt;This walk-through assumes you are setting up Identity Server in a production/QA environment, and not as a single machine/developer setup. Hence why we are setting up by using SQL Server instead of mounting the Compact database included in the App_Data directory, as well as installing the ASP.NET Membership provider DB on the DB Server.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;Download &lt;strong&gt;source&lt;/strong&gt; from &lt;a href="http://identityserver.codeplex.com/releases/view/78191#DownloadId=310266" target="_blank"&gt;here&lt;/a&gt;&lt;br /&gt;Unzip the file and open the solution. &lt;br /&gt;Because Identity Server (IdSvr) needs an ASP.NET membership database, we are going to set one up (if it doesn’t exist). There are some great tutorials on the web on how to do this (if you don’t already know), &lt;a href="http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx" target="_blank"&gt;here&lt;/a&gt; is one of them.&lt;br /&gt;After having installed the &lt;strong&gt;ASP.NET Membership database&lt;/strong&gt;, we are going to update the connection string in IdSvr to point to said database.&lt;br /&gt;The connection string file is located at&amp;nbsp; \Configuration\connectionstring.config (Below is an example)&lt;br /&gt;&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;connectionStrings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;  &lt;span style="background-color: yellow;"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;add&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="ProviderDB"&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span style="background-color: yellow;"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;       &lt;span class="attr"&gt;connectionString&lt;/span&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;span style="background-color: yellow;"&gt;="Persist Security Info=False;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="background-color: yellow;"&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;       User ID=sa; &lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span style="background-color: yellow;"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;       password=****;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="background-color: yellow;"&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;       Initial Catalog=aspnetdb;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span style="background-color: yellow;"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;       Data Source=mydbserver;"&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="background-color: yellow;"&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;       &lt;span class="attr"&gt;providerName&lt;/span&gt;&lt;span class="kwrd"&gt;="System.Data.SqlClient"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;  &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;To test that the connection string works, in &lt;strong&gt;Solution Explorer&lt;/strong&gt;, you should select the &lt;strong&gt;Website&lt;/strong&gt; project, then from Visual Studio’s menu, select Project –&amp;gt; ASP.NET Configuration. This will launch the ASP.NET Web Site Administration Tool. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/-QA1OFz5lvF4/Tu9iWBunpeI/AAAAAAAAD5A/rJKQWxtAoCE/s1600-h/Screen-Shot-2011-12-09-at-12.17.59-P.png"&gt;&lt;img alt="Screen Shot 2011-12-09 at 12.17.59 PM" border="0" height="528" src="http://lh6.ggpht.com/-4rVNj8f4s1Q/Tu9iWcthQVI/AAAAAAAAD5I/CKDTua9wCDs/Screen-Shot-2011-12-09-at-12.17.59-P%25255B1%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Screen Shot 2011-12-09 at 12.17.59 PM" width="353" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/-17URAE7JEIs/Tu9iWuztfFI/AAAAAAAAD5Q/LNbIct2bh0I/s1600-h/Screen-Shot-2011-12-09-at-12.18.14-P%25255B2%25255D.png"&gt;&lt;img alt="Screen Shot 2011-12-09 at 12.18.14 PM" border="0" height="412" src="http://lh3.ggpht.com/-8xS8Sk5UFvo/Tu9iW4I0qCI/AAAAAAAAD5Y/7gzFGuiN5R4/Screen-Shot-2011-12-09-at-12.18.14-P%25255B1%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Screen Shot 2011-12-09 at 12.18.14 PM" width="542" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using the ASP.NET Web Site Administration Tool, proceed to create a user (i.e.: &lt;em&gt;&lt;strong&gt;Administrator&lt;/strong&gt;&lt;/em&gt;) and a roles called &lt;strong&gt;IdentityServerAdministrators and IdentityServerUsers. &lt;/strong&gt;These roles are important because they allow the user created to logon to&amp;nbsp; IdSvr’s administration screen, and in the case of &lt;strong&gt;IdentityServerUsers&lt;/strong&gt;, to be forwarded to the RPs upon successful login.&amp;nbsp; These roles are specified in the &lt;em&gt;&lt;strong&gt;Constants.cs&lt;/strong&gt;&lt;/em&gt; file inside of the&lt;strong&gt; Thinktecture.IdentityServer.Core&lt;/strong&gt; project. &lt;br /&gt;&lt;br /&gt;&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Constants&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;       &lt;span class="rem"&gt;// ....&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Roles&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;const&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; InternalRolesPrefix          = &lt;span class="str"&gt;"IdentityServer"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;const&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Users                        = &lt;span class="str"&gt;"Users"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;const&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Administrators               = &lt;span class="str"&gt;"Administrators"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt; &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;const&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; IdentityServerUsers          = &lt;span style="background-color: yellow;"&gt;InternalRolesPrefix + Users;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;const&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; IdentityServerAdministrators = &lt;span style="background-color: yellow;"&gt;InternalRolesPrefix + Administrators&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/-wKzFGlPYogE/Tu9iXPImmAI/AAAAAAAAD5g/OzgsopSYPPA/s1600-h/image%25255B8%25255D.png"&gt;&lt;img alt="image" border="0" height="408" src="http://lh6.ggpht.com/-cdClUSBJL9w/Tu9iXQCl4rI/AAAAAAAAD5o/WJRLjujVqkg/image_thumb%25255B4%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="558" /&gt;&lt;/a&gt;&lt;a href="http://lh4.ggpht.com/-o-31Fpr04EY/Tu9iXuF-j1I/AAAAAAAAD5w/ADOFjTTcdr0/s1600-h/image%25255B9%25255D.png"&gt;&lt;img alt="image" border="0" height="405" src="http://lh4.ggpht.com/-NSs0jHkWEFo/Tu9iX8vxKJI/AAAAAAAAD54/ZJCJUDMz4fE/image_thumb%25255B5%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="554" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/-R4DRMJy8bQk/Tu9iYOPtjHI/AAAAAAAAD6A/JFvcD4lY_ow/s1600-h/Screen-Shot-2011-12-09-at-12.18.21-P%25255B2%25255D.png"&gt;&lt;img alt="Screen Shot 2011-12-09 at 12.18.21 PM" border="0" height="467" src="http://lh5.ggpht.com/-jrgeEl4V8Jk/Tu9iYTSIftI/AAAAAAAAD6I/vZ4i0eaXF9w/Screen-Shot-2011-12-09-at-12.18.21-P%25255B1%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Screen Shot 2011-12-09 at 12.18.21 PM" width="613" /&gt;&lt;/a&gt;&lt;a href="http://lh4.ggpht.com/-pkTOxLB45H0/Tu9iYsOyvfI/AAAAAAAAD6Q/C3FL0LUFFGk/s1600-h/Screen-Shot-2011-12-09-at-12.18.40-P.png"&gt;&lt;img alt="Screen Shot 2011-12-09 at 12.18.40 PM" border="0" height="219" src="http://lh3.ggpht.com/-h7rIExuRPK4/Tu9iY7DcV_I/AAAAAAAAD6Y/e95T0Mb3ZvU/Screen-Shot-2011-12-09-at-12.18.40-P%25255B2%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Screen Shot 2011-12-09 at 12.18.40 PM" width="632" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Configuring IIS 7&lt;/h2&gt;&lt;br /&gt;Let’s proceed to configure IIS 7 to host the Identity Server website. We will need to:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Request a Certificate for SSL (self-signed, Domain cert or commercial). Read this &lt;a href="http://www.digicert.com/csr-creation-microsoft-iis-7.htm"&gt;tutorial&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Setup https bindings. Go to this &lt;a href="http://learn.iis.net/page.aspx/144/how-to-set-up-ssl-on-iis/#SSL"&gt;link&lt;/a&gt;, and scroll down to &lt;strong&gt;Create an SSL Binding.&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2&gt;Creating a certificate for Token Signing&lt;/h2&gt;&lt;br /&gt;The process of creating this certificate is the same as requesting a certificate for SSL. Why not just the SSL Certificate then? – May you ask?–, and the answer is:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;“Using the SSL certificate for the token signing certificate will work – but this should not be the configuration you use in production. This is considered bad key hygiene.”&lt;br /&gt;&lt;br /&gt;Source:&lt;a href="http://blogs.technet.com/b/adfs/archive/2007/07/23/adfs-certificates-ssl-token-signing-and-client-authentication-certs.aspx"&gt;Technet&lt;/a&gt;&lt;/blockquote&gt;&lt;br /&gt;In my case, I have requested two certificates to the Domain Certificate Authority. &lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;&lt;strong&gt;***UPDATE: Make sure the certificate Distinguished Name of each certificate is different (i.e.: Don’t request two certificates with the same attributes). I ran into an issue where IdentityServer’s x509Certificate Helper could not find the right certificate because there were two certificates, and it didn’t like that. &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="codeSnippetWrapper"&gt;&lt;pre id="codeSnippet" style="background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;var certs = store.Certificates.Find(findType, &lt;span style="color: blue;"&gt;value&lt;/span&gt;, &lt;span style="color: blue;"&gt;false&lt;/span&gt;);&lt;br /&gt; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (certs.Count != 1) &lt;br /&gt; { &lt;br /&gt;     &lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; InvalidOperationException(String.Format(&lt;span style="color: #006080;"&gt;"Certificate not found: {0}"&lt;/span&gt;, &lt;span style="color: blue;"&gt;value&lt;/span&gt;));  &lt;br /&gt; }&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2&gt;&amp;nbsp;&lt;a href="http://lh3.ggpht.com/-SSkxrjIL4rU/Tu9iZNF7YNI/AAAAAAAAD6g/Gx4VTdergD4/s1600-h/IISCerts4.png"&gt;&lt;img alt="IISCerts" border="0" height="431" src="http://lh5.ggpht.com/-0SFCadc7Ue4/Tu9iZV94O-I/AAAAAAAAD6o/EQkb-A4MAqI/IISCerts_thumb2.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="IISCerts" width="917" /&gt;&lt;/a&gt;&lt;/h2&gt;&lt;br /&gt;We are almost there.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Configuring Identity Server&lt;/h2&gt;&lt;br /&gt;You should be able to navigate to Identity Server’s URL. If the certificates you created are not trusted by your computer, you see this screen. This occurs if you are using a certificate issued by a CA your computer does not trust. &lt;a href="http://msmvps.com/blogs/cgross/archive/2006/10/23/Vista-RC2_2C00_-IE7-and-SBS-Self_2D00_Signed-Certs.aspx" target="_blank"&gt;Here&lt;/a&gt; is a link on how to trust the certificate.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-Hn4tEAEGlqo/Tu9iZgmaPLI/AAAAAAAAD6w/V9zQ87wDBUI/s1600-h/image%25255B19%25255D.png"&gt;&lt;img alt="image" border="0" height="510" src="http://lh6.ggpht.com/-LY6Pq9fhReU/Tu9iZwnP7rI/AAAAAAAAD64/TssuuyCSxis/image_thumb%25255B13%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="553" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You should be seeing Identity Server’s initial configuration screen.&amp;nbsp; Go ahead and customize the first two fields to match your environment, and select the certificate that will be used for token signing.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/-TwnVeZnbqOY/Tu9iaMu3cYI/AAAAAAAAD7A/m4W7QuWt-1k/s1600-h/image%25255B26%25255D.png"&gt;&lt;img alt="image" border="0" height="560" src="http://lh6.ggpht.com/-ncJCqrg9aBQ/Tu9iafGBWNI/AAAAAAAAD7I/Tjo_DbMq5tw/image_thumb%25255B18%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="572" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Tada!! You have successfully configured Identity Server and should be ready to add your application as a Relaying Party (RP). You can find a tutorial on how to do that over &lt;a href="http://msdn.microsoft.com/en-us/library/ee517285.aspx" target="_blank"&gt;here&lt;/a&gt; (scroll down to 2.Register an existing production STS).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/--EBMNJQ7GjM/Tu9ia3DLXVI/AAAAAAAAD7U/LQN4BbjtCEI/s1600-h/image%25255B32%25255D.png"&gt;&lt;img alt="image" border="0" height="441" src="http://lh3.ggpht.com/-xMVyt96vt0Q/Tu9ich3JGtI/AAAAAAAAD7c/TIJeanbZ6wM/image_thumb%25255B22%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="584" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1521206372627229850-9218344956839016057?l=claudioasanchez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claudioasanchez.blogspot.com/feeds/9218344956839016057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claudioasanchez.blogspot.com/2011/12/walk-though-of-provisioning-identity.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/9218344956839016057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/9218344956839016057'/><link rel='alternate' type='text/html' href='http://claudioasanchez.blogspot.com/2011/12/walk-though-of-provisioning-identity.html' title='Walk-through of provisioning Identity Server v1.0'/><author><name>Claudio Sanchez</name><uri>http://www.blogger.com/profile/04611561704063156872</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/-CfDBxJE5y3k/TVvnSVN0yEI/AAAAAAAADyU/8L7qqVLrM20/s220/Claudio.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-4rVNj8f4s1Q/Tu9iWcthQVI/AAAAAAAAD5I/CKDTua9wCDs/s72-c/Screen-Shot-2011-12-09-at-12.17.59-P%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1521206372627229850.post-1077275765668251657</id><published>2011-11-13T17:41:00.001-08:00</published><updated>2011-11-16T16:22:12.405-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WIF'/><category scheme='http://www.blogger.com/atom/ns#' term='Talk'/><title type='text'>CMAP CodeCamp Slide Deck</title><content type='html'>Wow!! What an awesome experience to have participated in CMAP's CodeCamp.&amp;nbsp;&amp;nbsp; &lt;br /&gt;I have started the process of going from having a wealth of opinion and a lack of experience, to a more balanced mix.&amp;nbsp; I have made a mental note of a myriad of things that need to be improved, and will continue to improve the talk and gain more experience every time I do it.&amp;nbsp; &lt;br /&gt;Thanks to the audience for being so patient with me and not have walked out on me.&amp;nbsp; The slides are &lt;a href="http://www.megsoftconsulting.com/presentations/WIF/Intro%20to%20Windows%20Identity%20Foundation.pptx"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://app.sliderocket.com:80/app/fullplayer.aspx?id=4faa3ff9-05e8-4c7f-a80f-9d5a4cfe794e" width="500" height="401" scrolling=no frameBorder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1521206372627229850-1077275765668251657?l=claudioasanchez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claudioasanchez.blogspot.com/feeds/1077275765668251657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claudioasanchez.blogspot.com/2011/11/cmap-codecamp-slide-deck.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/1077275765668251657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/1077275765668251657'/><link rel='alternate' type='text/html' href='http://claudioasanchez.blogspot.com/2011/11/cmap-codecamp-slide-deck.html' title='CMAP CodeCamp Slide Deck'/><author><name>Claudio Sanchez</name><uri>http://www.blogger.com/profile/04611561704063156872</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/-CfDBxJE5y3k/TVvnSVN0yEI/AAAAAAAADyU/8L7qqVLrM20/s220/Claudio.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1521206372627229850.post-3249865968870017966</id><published>2011-11-04T06:45:00.001-07:00</published><updated>2011-11-04T06:49:28.216-07:00</updated><title type='text'>Speaking at CMAP's Fall Code Camp</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;It is official. I will be speaking at a local CodeCamp about Windows Identity Foundation. There are many interesting talks and the best part is that is all free. Check it out and do not miss it.&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; font-size: 12px; line-height: 20px;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote class="tr_bq"&gt;The Central Maryland Association of .NET Professionals (CMAP) is holding its Fall 2011 Code Camp on&amp;nbsp;&lt;strong style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: inherit; font-size: 12px; font-style: inherit; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Saturday, November 12th, 2011&lt;/strong&gt;&amp;nbsp;at the Loyola University Maryland Graduate Center in Columbia, MD.&lt;br /&gt;The Code Camp will run from 8:30am - 5:30pm with 20-25 awesome sessions covering a wide range of database, software and portal development topics. It's totally free. No gimmicks. No sales pitches. Enjoy breakfast and lunch at no charge while you mingle with your peers.&lt;/blockquote&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;For more details click &lt;a href="http://www.cmap-online.org/CodeCamp/Default.aspx"&gt;here&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-NmgABCmErlY/TrPsdIP65pI/AAAAAAAAD4g/ZFSoBbpg1lY/s1600/Screen+Shot+2011-11-04+at+9.44.50+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="197" src="http://1.bp.blogspot.com/-NmgABCmErlY/TrPsdIP65pI/AAAAAAAAD4g/ZFSoBbpg1lY/s400/Screen+Shot+2011-11-04+at+9.44.50+AM.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1521206372627229850-3249865968870017966?l=claudioasanchez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claudioasanchez.blogspot.com/feeds/3249865968870017966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claudioasanchez.blogspot.com/2011/11/speaking-at-cmaps-fall-code-camp.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/3249865968870017966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/3249865968870017966'/><link rel='alternate' type='text/html' href='http://claudioasanchez.blogspot.com/2011/11/speaking-at-cmaps-fall-code-camp.html' title='Speaking at CMAP&apos;s Fall Code Camp'/><author><name>Claudio Sanchez</name><uri>http://www.blogger.com/profile/04611561704063156872</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/-CfDBxJE5y3k/TVvnSVN0yEI/AAAAAAAADyU/8L7qqVLrM20/s220/Claudio.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-NmgABCmErlY/TrPsdIP65pI/AAAAAAAAD4g/ZFSoBbpg1lY/s72-c/Screen+Shot+2011-11-04+at+9.44.50+AM.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1521206372627229850.post-1453872652202298400</id><published>2011-10-05T17:57:00.000-07:00</published><updated>2011-11-04T06:44:39.259-07:00</updated><title type='text'>We will remember you Steve</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;Steve Jobs will always be in my mind. He was indeed an influential person in my life, an inspiration and a &amp;nbsp;role model. He was living proof that you can create your own destiny, without worriying too much about the path society expects you to follow to be defined as successful.&lt;/div&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 11px; line-height: 14px;"&gt;"Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma - which is living with the results of other people's thinking. Don't let the noise of other's opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary." - Steve Jobs&lt;/span&gt;&lt;/blockquote&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/-weqx8hGMxnI/Toz6vo-l43I/AAAAAAAAD4I/5Cl2_3AUBL0/s1600/Screen+Shot+2011-10-05+at+8.06.27+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="307" src="http://2.bp.blogspot.com/-weqx8hGMxnI/Toz6vo-l43I/AAAAAAAAD4I/5Cl2_3AUBL0/s400/Screen+Shot+2011-10-05+at+8.06.27+PM.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1521206372627229850-1453872652202298400?l=claudioasanchez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claudioasanchez.blogspot.com/feeds/1453872652202298400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claudioasanchez.blogspot.com/2011/10/we-will-remember-you-steve.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/1453872652202298400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/1453872652202298400'/><link rel='alternate' type='text/html' href='http://claudioasanchez.blogspot.com/2011/10/we-will-remember-you-steve.html' title='We will remember you Steve'/><author><name>Claudio Sanchez</name><uri>http://www.blogger.com/profile/04611561704063156872</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/-CfDBxJE5y3k/TVvnSVN0yEI/AAAAAAAADyU/8L7qqVLrM20/s220/Claudio.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-weqx8hGMxnI/Toz6vo-l43I/AAAAAAAAD4I/5Cl2_3AUBL0/s72-c/Screen+Shot+2011-10-05+at+8.06.27+PM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1521206372627229850.post-2596134224270109142</id><published>2011-09-28T19:07:00.000-07:00</published><updated>2011-10-03T07:48:08.182-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='WIF'/><category scheme='http://www.blogger.com/atom/ns#' term='Single Sign-on'/><category scheme='http://www.blogger.com/atom/ns#' term='Federated Security'/><title type='text'>Setting up Thinktecture’s Identity Server</title><content type='html'>&lt;p&gt;The following tutorial assumes the reader is familiar with the following technologies/concepts:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Single Sign-on (SSO) &lt;/li&gt;&lt;li&gt;Windows Identity Foundation (WIF) &lt;/li&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Active_Directory_Federation_Services" target="_blank"&gt;Active Directory Federation Services&lt;/a&gt; &lt;/li&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Claims_Based_Identity" target="_blank"&gt;Claims-based identity&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This post is a&amp;#160; how to setup Thinktecture’s &lt;strike&gt;StarterSTS&lt;/strike&gt; &lt;a href="http://identityserver.codeplex.com/" target="_blank"&gt;Identity Server&lt;/a&gt; [B1]. &lt;/p&gt;&lt;p&gt;1. Download the Source Code from the Codeplex site [at the time of this writing, the current version is B1 Refresh] and unzip it on your local drive.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/-9kbCwc7EJbk/ToR4n_h3oyI/AAAAAAAAD2g/umvOsk1JpIk/s1600-h/image3.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://lh6.ggpht.com/-nxlLrzvUSPw/ToR4oNlVnGI/AAAAAAAAD2k/8sIvZvffPXQ/image_thumb1.png?imgmax=800" width="502" height="309" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;2) Once the Solution is opened in Visual Studio, inside of the Tools solution folder you will find a Setup project. Run the project by right clicking on it, Selecting Debug –&amp;gt; Start new instance.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/-0vUg_drAnUM/ToR4orLRtBI/AAAAAAAAD2o/E-iLz9TuwVQ/s1600-h/image7.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://lh5.ggpht.com/-FktLkITcDcs/ToR4o6dlrLI/AAAAAAAAD2s/x1DGuow6w-A/image_thumb3.png?imgmax=800" width="502" height="454" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;3) Set the Location of the Configuration Database as shown below. &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/-QgM7k95wBi0/ToR4pUCBexI/AAAAAAAAD2w/Xe5R98cAKhw/s1600-h/image11.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://lh6.ggpht.com/-Sp9VnHZJBQY/ToR4pkwLfeI/AAAAAAAAD20/KB26aBxcrSg/image_thumb5.png?imgmax=800" width="413" height="224" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;You can find the file called &lt;em&gt;&lt;strong&gt;IdentityServerConfiguration.sdf&lt;/strong&gt;&lt;/em&gt; inside of the &lt;strong&gt;App_Data&lt;/strong&gt; folder of the &lt;strong&gt;Website&lt;/strong&gt; Project. &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/-pvCEgJh-Yq4/ToR4qNsYR8I/AAAAAAAAD24/SHmMimXVvQA/s1600-h/image15.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://lh5.ggpht.com/-dnpKZynOXik/ToR4qQbPUqI/AAAAAAAAD28/INVtByYBAdk/image_thumb7.png?imgmax=800" width="475" height="265" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;4) Select the certificate that will be used for SSL Encryption. **Note: If you already have IIS setup with SSL, you most definitely want to use the same certificate. I suspect you will, because if you are installing this Identity Server you must be very familiar with the Windows Identity Foundation configuration dance. &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/-DKDWbA5z23Y/ToR4qzwTu5I/AAAAAAAAD3A/GVhDHNTzcZ8/s1600-h/image21.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://lh6.ggpht.com/-j3u9Vu76Abo/ToR4rOPhnyI/AAAAAAAAD3E/YVfn7XM8t6k/image_thumb9.png?imgmax=800" width="235" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;5) Select the certificate that will be used for Signing (You can use the same certificate)&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/-56TpPpv70ag/ToR4rVq_B_I/AAAAAAAAD3I/2M6t3vSZZPg/s1600-h/image25.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 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://lh6.ggpht.com/-OU0KFW4HvhU/ToR4r3OyzdI/AAAAAAAAD3M/QBMLvHKryb4/image_thumb10.png?imgmax=800" width="235" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/-ir6zAXka7Ak/ToR4sKPN0FI/AAAAAAAAD3Q/QkTiWFVqz2U/s1600-h/image28.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 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://lh3.ggpht.com/-MgClmQF80n4/ToR4srskYxI/AAAAAAAAD3U/chLJVkw7Q64/image_thumb11.png?imgmax=800" width="244" height="133" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;After this is done, you might be thinking that you can run the [website] project now and it should just work, right? Thought WRONG! There is no free meal in this world. Our friend Dominick [Baier] has had this running on his machine for a while, so perhaps forgot about setting up IIS, the ASP.NET provider Database and all that business. &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/-H10FSg_FEQs/ToR4s4zOv2I/AAAAAAAAD3Y/9FZvMNL27i0/s1600-h/image32.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://lh5.ggpht.com/-BTe2f9awzm4/ToR4tOxcwxI/AAAAAAAAD3c/QBsGwtpwJuE/image_thumb13.png?imgmax=800" width="473" height="223" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;h2&gt;SEtting up ThE WEBSITE PROJECT TO USE IIS&lt;/h2&gt;&lt;p&gt;So, right after you download the source code, the Web Project Properties looks like so:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/-hyM7sz_aKBc/ToR4tpmb7_I/AAAAAAAAD3g/4mXZTZtfGMI/s1600-h/image43.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://lh4.ggpht.com/-yMc_DaBvNxQ/ToR4t-CcTwI/AAAAAAAAD3k/VJ0nFzeQcTI/image_thumb18.png?imgmax=800" width="495" height="362" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Notice the “[X] Use Custom Web Server” option is selected, and points to &lt;a href="https://roadie/idsrv/"&gt;https://roadie/idsrv/&lt;/a&gt;. You want to change these setting as follows:&lt;/p&gt;&lt;p&gt;Switch the setting to Use Local IIS Web Server and enter a more appropriate URL (&lt;em&gt;i.e.:&lt;/em&gt;&lt;a title="http://csanchezpc/IdentityServer/idsrv" href="http://[your machine&amp;rsquo;s fully qualified name]/idsrv"&gt;&lt;em&gt;http://[your machine’s fully qualified name]/idsrv&lt;/em&gt;&lt;/a&gt;), or if you are one cool cat, you may choose Use IIS Express (but then, you are on your own). &lt;/p&gt;&lt;p&gt;We are almost there, do not despair. &lt;/p&gt;&lt;h2&gt;CONFIGURING THE ASP.NET MEMBERSHIP DB. &lt;/h2&gt;&lt;p&gt;If you were to try to run the Website, you should get this “Yellow page of death”. And that is due to the fact (if you are one of those who do no read error pages) that the 1) you have not installed the standard ASP.NET Membership schema, and 2) the Identity under which IIS is running does not have access to said database (provided it existed). Follow &lt;a href="http://weblogs.asp.net/sukumarraju/archive/2009/10/02/installing-asp-net-membership-services-database-in-sql-server-expreess.aspx" target="_blank"&gt;these&lt;/a&gt; instructions to setup the ASP.NET application services schema.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/-T6G9d_No5vY/ToR4uR7tJ6I/AAAAAAAAD3o/8fVmj52sun8/s1600-h/image53.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://lh6.ggpht.com/-KDJyNtshf-0/ToR4uoc3rvI/AAAAAAAAD3s/qY-PO-nW_CM/image_thumb22.png?imgmax=800" width="456" height="373" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;After having installed the ASP.NET Schema on your SQL Server instance, go to SQL Server Management Studio, and under Security –&amp;gt; Logins, and make sure that the Identity under which your IIS Application Pool is running has a valid login in SQL Server and has the right access to the ASP.NET database. In my case, the App pool Identity is &lt;em&gt;'IIS APPPOOL\DefaultAppPool'&lt;/em&gt; and the database named &amp;quot;aspnetdb&amp;quot;.&lt;a href="http://lh3.ggpht.com/-dTxr2mpT4V8/ToR4vKMeNLI/AAAAAAAAD3w/HY0HsumklA8/s1600-h/image65.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://lh3.ggpht.com/-DpFULgqlRrQ/ToR4vpR4guI/AAAAAAAAD30/hcUESBmlN-Q/image_thumb28.png?imgmax=800" width="409" height="505" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/-nInxLMAF1yA/ToR4v1050nI/AAAAAAAAD34/2J9r2x7BRr8/s1600-h/image73.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://lh6.ggpht.com/-0WzsOnfn_7A/ToR4wKpxuSI/AAAAAAAAD38/eWxyFdkGqqY/image_thumb32.png?imgmax=800" width="481" height="411" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Lastly, change the Website\Configuration\connectionStrings.config file to point to your ASP.NET application services database. &lt;/p&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 503px; padding-right: 5px; height: 187px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;connectionStrings&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: 10px"&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;ProviderDB&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #ff0000"&gt;connectionString&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;data source=.\sqlexpress;Integrated Security=SSPI;Initial Catalog=aspnetdb&amp;quot;&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: 10px"&gt;&lt;span style="color: #ff0000"&gt;providerName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;System.Data.SqlClient&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: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&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;IdentityServerConfigurationEntities&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 96.19%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; height: 82px; font-size: 10px"&gt;&lt;span style="color: #ff0000"&gt;connectionString&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;metadata=res://Thinktecture.IdentityServer.Core/Repositories.SqlCompact.IdentityServerConfiguration.csdl|res://Thinktecture.IdentityServer.Core/Repositories.SqlCompact.IdentityServerConfiguration.ssdl|res://Thinktecture.IdentityServer.Core/Repositories.SqlCompact.IdentityServerConfiguration.msl;provider=System.Data.SqlServerCe.4.0;provider connection string=&amp;amp;quot;Data Source=|DataDirectory|\IdentityServerConfiguration.sdf&amp;amp;quot;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #ff0000"&gt;providerName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;System.Data.EntityClient&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: 10px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;connectionStrings&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If you did everything right, you should now be able to run the application and get this page. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/-dqDNx8josbI/ToR4wbwc7VI/AAAAAAAAD4A/XWAgQ51W9zU/s1600-h/image77.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://lh4.ggpht.com/-w06xJiA5mVg/ToR4ww_8pZI/AAAAAAAAD4E/atq5Y4JtScY/image_thumb34.png?imgmax=800" width="415" height="394" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Accessing the Administration Mode of Identity Server&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Out of the box, IdentityServer is configured to use the &lt;font face="Courier New"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.security.sqlmembershipprovider.aspx" target="_blank"&gt;SqlMembershipProvider&lt;/a&gt;&amp;#160;&lt;/font&gt;&lt;font face="Arial"&gt;membership provider implementation. Therefore to login you have to:&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;font face="Arial"&gt;create a user (&lt;em&gt;i.e.: Administrator&lt;/em&gt;)&lt;/font&gt; &lt;/li&gt;&lt;li&gt;&lt;font face="Arial"&gt;create a role called &lt;strong&gt;IdentityServerAdministrators.&lt;/strong&gt;&lt;/font&gt; &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Arial"&gt;Both of these can be accomplished by using the built-in Web Site Administration Tool (in Visual Studio, go to Project –&amp;gt;&amp;#160; ASP.NET Configuration). &lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;[FYI] C&lt;/strong&gt;ontrary to what&amp;#160; Dominik Baier’s introductory &lt;a href="http://identity.thinktecture.com/download/identityserver/identityserverctp1.wmv" target="_blank"&gt;video&lt;/a&gt; says [9:02] &lt;/font&gt;, the role the code is expecting is not “TokenServiceAdministrators”, but instead, &lt;strong&gt;IdentityServerAdministrators&lt;/strong&gt;).&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;[Change for Improvement] &lt;/strong&gt;This can be improved in the future by modifying the provided implementation of&amp;#160; &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.identitymodel.claims.claimsauthorizationmanager.aspx" target="_blank"&gt;ClaimsAuthorizationManager&lt;/a&gt;, and changing the AuthorizeAdministration Method (inside of Thinktecture.IdentityServer.Web.Security.AuthorizationManager) &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 459px; padding-right: 5px; height: 121px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;virtual&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; AuthorizeAdministration(Collection&amp;lt;Claim&amp;gt; resource, IClaimsIdentity id)&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: 10px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (id.ClaimExists(ClaimTypes.Role, Constants.Roles.IdentityServerAdministrators));&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: 10px"&gt;}&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The next article will describe how to create a configure your application (Relaying Party) to trust Identity Server as an Secure Token Service (STS). &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1521206372627229850-2596134224270109142?l=claudioasanchez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claudioasanchez.blogspot.com/feeds/2596134224270109142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claudioasanchez.blogspot.com/2011/09/setting-up-thinktectures-identity.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/2596134224270109142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/2596134224270109142'/><link rel='alternate' type='text/html' href='http://claudioasanchez.blogspot.com/2011/09/setting-up-thinktectures-identity.html' title='Setting up Thinktecture’s Identity Server'/><author><name>Claudio Sanchez</name><uri>http://www.blogger.com/profile/04611561704063156872</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/-CfDBxJE5y3k/TVvnSVN0yEI/AAAAAAAADyU/8L7qqVLrM20/s220/Claudio.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-nxlLrzvUSPw/ToR4oNlVnGI/AAAAAAAAD2k/8sIvZvffPXQ/s72-c/image_thumb1.png?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1521206372627229850.post-3737192449662139681</id><published>2011-09-01T08:24:00.001-07:00</published><updated>2011-09-01T08:34:23.030-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DDD'/><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='T-SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Development Workflow'/><title type='text'>Where my data files at!?</title><content type='html'>&lt;p&gt;&lt;strong&gt;A bit of context:&lt;/strong&gt; As part of my team’s development workflow, we create/modify our &lt;a href="http://en.wikipedia.org/wiki/Domain_model" target="_blank"&gt;Domain Model&lt;/a&gt; in code (entities such as Customer, Product, Order, etc.) and then generate the &lt;a href="http://en.wikipedia.org/wiki/Database_model" target="_blank"&gt;Database Model&lt;/a&gt; via a homegrown console app.&amp;#160; This allows us to&amp;#160; [efficiently]&amp;#160; code our Domain Model without having to worry about applying these changes to the lower layers of the system all the way to the database schema. &lt;/p&gt;  &lt;p&gt;The [Schema Export] console app I mentioned automatically generates a fresh database by exploring our Domain Model – &lt;a href="http://elliottjorgensen.com/nhibernate-api-ref/NHibernate.Tool.hbm2ddl/SchemaExport.html" target="_blank"&gt;NHibernate&lt;/a&gt; makes this very easy - for the purpose of &lt;a href="http://msdn.microsoft.com/en-us/library/dd193250.aspx" target="_blank"&gt;comparing and synchronizing&lt;/a&gt; with the &lt;a href="http://msdn.microsoft.com/en-us/library/ff678491.aspx" target="_blank"&gt;Database Project&lt;/a&gt; , thus bringing our Persistence store up-to-date with our Domain Model. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Problem: &lt;/strong&gt;I had a need to find out the physical path was the instance of SQL Server installed on the server [&lt;em&gt;c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\&lt;/em&gt;] and thus were the data files for the database are placed [$SqlInstallPath\MSSQL\Data\].&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Solution:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The following T-SQL returned the path where the master database is located:&lt;/p&gt;  &lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 491px; padding-right: 5px; height: 81px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=select&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99"&gt;select&lt;/a&gt; physical_name &lt;a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=from&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99"&gt;from&lt;/a&gt; master.sys.databases dbs &lt;a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=inner&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99"&gt;inner&lt;/a&gt; &lt;a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=join&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99"&gt;join&lt;/a&gt; master.sys.master_files files &lt;a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=on&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99"&gt;on&lt;/a&gt; dbs.database_id = files.database_id&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: 10px"&gt;&lt;a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=where&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99"&gt;where&lt;/a&gt; dbs.name = '&lt;span style="color: #8b0000"&gt;master&lt;/span&gt;' &lt;a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=and&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99"&gt;and&lt;/a&gt; type_desc = '&lt;span style="color: #8b0000"&gt;ROWS&lt;/span&gt;'&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 456px; padding-right: 5px; height: 95px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;physical_name&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: 10px"&gt;&lt;span style="color: #008000"&gt;-------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;c:\Program Files\Microsoft &lt;a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=SQL&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99"&gt;SQL&lt;/a&gt; Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\master.mdf&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: 10px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;(1 row(s) affected)&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: 10px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;And the following function takes care of removing the filename and fiving you the path:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 475px; padding-right: 5px; height: 328px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetDbFilePath ( SqlConnection sqlConnection, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; databaseName )&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: 10px"&gt;        {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;            &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; path = &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Empty;&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: 10px"&gt;            &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&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: 10px"&gt;                &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; datafilepathQuery =&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;                    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format (&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: 10px"&gt;                        @&amp;quot;&lt;span style="color: #8b0000"&gt;select physical_name from &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;              master.sys.databases dbs inner join master.sys.master_files files &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: 10px"&gt;                on dbs.database_id = files.database_id&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;                where dbs.name = '{0}' and type_desc = 'ROWS'&lt;/span&gt;&amp;quot;, databaseName );&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: 10px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;                &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; ( var sqlCmd = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SqlCommand ( datafilepathQuery, sqlConnection ) )&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: 10px"&gt;                {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;                    &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; datafilepath = sqlCmd.ExecuteScalar ();&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: 10px"&gt;                    path = datafilepath.ToString ();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;                    path = path.Substring(0, path.LastIndexOf('\\'));&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: 10px"&gt;                }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&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: 10px"&gt;            &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; ( Exception )&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&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: 10px"&gt;            }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; path;&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: 10px"&gt;        }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This allowed me to subsequently run another command to create the database schema at the right location. That is all for today folks!&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;FYI:&lt;/strong&gt; I will be writing a post – or series of posts – on how to improve your development workflow and thus adhering to my favorite tenet of the &lt;a href="http://agilemanifesto.org/principles.html" target="_blank"&gt;Agile Manifesto&lt;/a&gt; : “maximizing the amount of work not done”.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1521206372627229850-3737192449662139681?l=claudioasanchez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claudioasanchez.blogspot.com/feeds/3737192449662139681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claudioasanchez.blogspot.com/2011/09/where-my-data-files-at.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/3737192449662139681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/3737192449662139681'/><link rel='alternate' type='text/html' href='http://claudioasanchez.blogspot.com/2011/09/where-my-data-files-at.html' title='Where my data files at!?'/><author><name>Claudio Sanchez</name><uri>http://www.blogger.com/profile/04611561704063156872</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/-CfDBxJE5y3k/TVvnSVN0yEI/AAAAAAAADyU/8L7qqVLrM20/s220/Claudio.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1521206372627229850.post-8950595998765729967</id><published>2011-06-22T06:36:00.000-07:00</published><updated>2011-06-22T06:52:39.972-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><title type='text'>Getting rid of Literal strings - part 1</title><content type='html'>&lt;p&gt;In my travels around MVVM Land (specially as seen on MSFT tutorials around the net), it is commonplace to find string literals being used when implementing the &lt;a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx" rel="tag" target="_blank"&gt;INotifyPropertyChanged&lt;/a&gt;, to specify the property name (as shown in the code below). &lt;/p&gt;  &lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 484px; padding-right: 5px; height: 353px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1:     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Customer : INotifyPropertyChanged&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: 10px"&gt;  2:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:         &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _firstName;&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: 10px"&gt;  4: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; FirstName&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: 10px"&gt;  6:         {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7:             &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; _firstName; }&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: 10px"&gt;  8: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9:             &lt;span style="color: #0000ff"&gt;set&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: 10px"&gt; 10:             {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11:                 _firstName = &lt;span style="color: #0000ff"&gt;value&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: 10px"&gt; 12:                 PropertyChanged(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PropertyChangedEventArgs(&amp;quot;&lt;span style="color: #8b0000"&gt;FirstName&lt;/span&gt;&amp;quot;));&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 13:             }&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: 10px"&gt; 14:         }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 15: &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: 10px"&gt; 16:         #region INotifyPropertyChanged Members&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 17: &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: 10px"&gt; 18:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;event&lt;/span&gt; PropertyChangedEventHandler PropertyChanged;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 19: &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: 10px"&gt; 20:         #endregion&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 21:     }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;But excessive use of the &lt;strong&gt;Copy + Paste “design pattern”&lt;/strong&gt;, can be error prone – often times when Copying + Pasting, I forget to change the string to the new property name, and/or misspell the intended name - causing your ViewModels not to work correctly. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Solution: &lt;/strong&gt;The guys at Microsoft Patterns &amp;amp; Practices&amp;#160; have included some nice &amp;quot;lifestyle enhancing” features in &lt;a href="http://compositewpf.codeplex.com/" target="_blank"&gt;Prism&lt;/a&gt; that make your everyday coding much enjoyable. One of those features is the &lt;a href="http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&amp;amp;l=EN-US&amp;amp;k=k(MICROSOFT.PRACTICES.PRISM.VIEWMODEL.NOTIFICATIONOBJECT);k(VS.OBJECTBROWSER);k(SOLUTIONITEMSPROJECT);k(TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22)&amp;amp;rd=true" target="_blank"&gt;NotificationObject&lt;/a&gt;, an abstract class that implements the INotifyPropertyChanged (INPC) interface, and allows you to write code such as this: &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 470px; padding-right: 5px; height: 253px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Customer : NotificationObject&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: 10px"&gt;  2:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:         &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _firstName;&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: 10px"&gt;  4: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; FirstName&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: 10px"&gt;  6:         {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7:             &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; _firstName; }&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: 10px"&gt;  8: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9:             &lt;span style="color: #0000ff"&gt;set&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: 10px"&gt; 10:             {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11:                 _firstName = &lt;span style="color: #0000ff"&gt;value&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: 10px"&gt; 12:                 RaisePropertyChanged(() =&amp;gt; FirstName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 13:             }&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: 10px"&gt; 14:         }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 15:     }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Notice that Line 12 does not use a “Magic String”, but rather a lambda expression that points to the property. This gives you compile-time checking as well as refactoring with ease. some improvements could be&amp;#160; made (i.e.: Only raising the Property Changed event when the value changes), but I will leave that up to you. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:93804077-0800-4349-9e13-6c24e63ea247" class="wlWriterEditableSmartContent"&gt;del.icio.us Tags: &lt;a href="http://del.icio.us/popular/DataBinding" rel="tag"&gt;DataBinding&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/Prism4" rel="tag"&gt;Prism4&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/MVVM" rel="tag"&gt;MVVM&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/WPF" rel="tag"&gt;WPF&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/Silverlight" rel="tag"&gt;Silverlight&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/1521206372627229850-8950595998765729967?l=claudioasanchez.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claudioasanchez.blogspot.com/feeds/8950595998765729967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claudioasanchez.blogspot.com/2011/06/getting-rid-of-literal-strings-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/8950595998765729967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1521206372627229850/posts/default/8950595998765729967'/><link rel='alternate' type='text/html' href='http://claudioasanchez.blogspot.com/2011/06/getting-rid-of-literal-strings-part-1.html' title='Getting rid of Literal strings - part 1'/><author><name>Claudio Sanchez</name><uri>http://www.blogger.com/profile/04611561704063156872</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/-CfDBxJE5y3k/TVvnSVN0yEI/AAAAAAAADyU/8L7qqVLrM20/s220/Claudio.png'/></author><thr:total>0</thr:total></entry></feed>
