[5.0] Claims authentification FedAuth cookie not fill after

Posted by Community Admin on 04-Aug-2018 14:33

[5.0] Claims authentification FedAuth cookie not fill after AuthenticateUser

All Replies

Posted by Community Admin on 12-Apr-2012 00:00

Hello,

I use this method SecurityManager.AuthenticateUser(...) to login automatically a user.

The user is logged but the cookies FedAuth isn't generate. Why?
If I refresh the page this user isn't more logged.  

Thanks for your help

Posted by Community Admin on 13-Apr-2012 00:00

I post this thread like a issue.
And here my tips to around this problem:

1.IClaimsPrincipal claimsPrincipal = ClaimsManager.GetCurrentPrincipal();
2.IClaimsIdentity claimsIdentity = (IClaimsIdentity)claimsPrincipal.Identity;
3.                                                                         
4.var token = FederatedAuthentication.SessionAuthenticationModule.CreateSessionSecurityToken(claimsPrincipal, "FedAuth", DateTime.UtcNow, DateTime.UtcNow.AddMinutes(20), true);
5.                                     
6.token.IsSessionMode = true;
7.                                  
8.FederatedAuthentication.SessionAuthenticationModule.WriteSessionTokenToCookie(token);

Posted by Community Admin on 17-May-2012 00:00

Thank you so much for posting your code.  I was struggling with this today while trying to create a custom login control.

Posted by Community Admin on 17-May-2012 00:00

While this worked for the local site it does not work for Single Sign On (SSO).  Any thoughts on what you'd have to do?  I presume you'd need to mess with the Simple Web Token SWT functions?  I'm new to claims and have no clue.

This thread is closed