I\'m having problems trying to decide on a route to take on a project I have.
I\'ve been reading up on OWIN specs and Katana implementation within .NET. The reason why I
Cmedine, based on Brett's answer i configured my authentication and authorization. I show you the code as you requested some sample code.
public partial class Startup
{
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
SlidingExpiration = false,
CookieName = "identity",
//short time for testing only
ExpireTimeSpan = TimeSpan.FromSeconds(120),
Provider = new CookieAuthenticationProvider
{
OnResponseSignIn = ctx =>
{
ctx.Identity = TransformClaims(ctx);
}
}
});
app.UseWsFederationAuthentication(
new WsFederationAuthenticationOptions
{
MetadataAddress = "https://[[ADFS_Url]]/FederationMetadata/2007-06/federationmetadata.xml",
Wtrealm = "[[realm]]",
UseTokenLifetime = false
}
);
}
private ClaimsIdentity TransformClaims(CookieResponseSignInContext ctx)
{
return new IdentityCreator().CreateIdentity(ctx.Identity, [[ApplicationName]]);
}
}
The IdentityCreator takes the ClaimsIdentity and an Application name and goes to a DB and gets the claims for that user in that application. Hope it helps!!