Note that there are some explanatory texts on larger screens.

plurals
  1. POClaimsPrincipal is null when it reaches WCF Service
    text
    copied!<p>I am currently implementing a Federated Authentication solution using: A passive STS for issuing tokens, a Website hosting a Silverlight application and WCF services for the Silverlight App.</p> <p>So far I am able:</p> <ul> <li>Get redirected to the STS</li> <li>Login and get redirected to the Website</li> <li>Display the claims on the website by accessing <code>HttpContext.Current.User.Identity as IClaimsIdentity;</code></li> </ul> <p>on the web.config of the Website, I have added the two WIF modules needed (under IIS 7)</p> <pre><code>&lt;modules runAllManagedModulesForAllRequests="true"&gt; &lt;add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler"/&gt; &lt;add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler"/&gt; &lt;/modules&gt; </code></pre> <p>I have also configured the Microsoft.IdentityModel section of the web.config to use my own implementation of ClaimsAuthenticationManager and ClaimsAthorizationManager.</p> <pre><code>&lt;service name="Rem.Ria.PatientModule.Web.WebService.PatientService"&gt; &lt;claimsAuthenticationManager type ="Rem.Infrastructure.WIF.RemClaimsAuthenticationManager"/&gt; &lt;claimsAuthorizationManager type ="Rem.Infrastructure.WIF.RemClaimsAuthorizationManager"/&gt; &lt;/service&gt; </code></pre> <p>My ClaimsAuthenticationMAnager is simply setting the Thread.CurrentPrincipal is a valid Principal is provided.</p> <pre><code>class RemClaimsAuthenticationManager : ClaimsAuthenticationManager { public override IClaimsPrincipal Authenticate ( string resourceName, IClaimsPrincipal incomingPrincipal ) { if ( incomingPrincipal.Identity.IsAuthenticated ) { Thread.CurrentPrincipal = incomingPrincipal; } return incomingPrincipal; } } } </code></pre> <p>The problem is that when my ClaimsAuthorizationManager is called, the context.Principal.Identity does not contain a valid Identity with Claims, and neither does the Thread.CurrentPrincipal.</p> <p>Any ideas?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload