title: ThinkTecture IdentityServer Authorize Directory
body: <p>I am attempting to use <a href="https://github.com/thinktecture/Thinktecture.IdentityServer.v2" rel="nofollow">Thinktecture Identity Server v2</a> as a federated identity manager. I have the identity server up and running and authentication works fine. My issue is that my test site I am using to test the authentication redirects to the identity server on page load at <code>localhost:8080/</code>, but what I would like to happen is the authentication redirect happen after a user clicks a link and only protect certain directories such as <code>localhost:8080/app/</code> and <code>localhost:8080/</code> should be accessible by non-authorized users. I essentially followed <a href="http://vimeo.com/51666380" rel="nofollow">this</a> tutorial to set up the IdP.</p>
  
  <p>My web.config currently contains</p>
  
  <pre><code>&lt;appSettings&gt;
      &lt;add key="ida:FederationMetadataLocation" value="https://localhost/idsrv/FederationMetadata/2007-06/FederationMetadata.xml" /&gt;
      &lt;add key="ida:Realm" value="https://localhost:8080/" /&gt;
      &lt;add key="ida:AudienceUri" value="http://localhost/" /&gt;
  &lt;appSettings&gt;
  ...
  &lt;system.identityModel.services&gt;
      &lt;federationConfiguration&gt;
          &lt;cookieHandler requireSsl="true" /&gt;
          &lt;wsFederation
              passiveRedirectEnabled="true"
              issuer="https://localhost/idsrv/issue/wsfed"
              realm="http://localhost/"
              requireHttps="true" /&gt;
      &lt;/federationConfiguration&gt;
  &lt;/system.identityModel.services&gt;
  </code></pre>
  
  <p>I have attempted to change the realm using</p>
  
  <pre><code>&lt;add key="ida:Realm" value="https://localhost:8080/app/" /&gt;
  </code></pre>
  
  <p>but the redirect still happens when I land on <code>localhost:8080/</code> instead of where I want it to happen at <code>localhost:8080/app/</code>.</p>
  
  <p><strong>EDIT</strong>: I guess what I am really asking here is what is a Realm and what is AudienceUri and how can I configure those to only protect certain sections (directories) of my app.</p>