BootstrapContext is null on ClaimsIdentity

I have created a new ASP.NET MVC application with .NET 4.5. I have successfully set up authentication with an STS. The authentication flow is working fine and I am able to get the ClaimsIdentity, containing the desired claims, on Thread.CurrentPrincipal.

Now I need the bootstrap token to secure the calls to my service layer. I have set the saveBootstrapContext to true on the identityConfiguration element.

    <identityConfiguration saveBootstrapContext="true">

However, the BootstrapContext property on the ClaimsIdentity is always null.

var identity = Thread.CurrentPrincipal.Identity as ClaimsIdentity;
var context = identity.BootstrapContext; // context is always null

Am I missing anything here? This was supposed to be straightforward :(

Read more here:

Content Attribution

This content was originally published by Unmesh Kondolikar at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: