Open zinov opened 9 years ago
Also I am trying to pass the user name and password to the website that I want to redirect, an there I can call my authentication service and I am writting this code but the cookie is not present at the end
var service = new AuthenticationServiceAgent(user.Username, user.Password);
GenericXmlSecurityToken token = service.GetToken() as GenericXmlSecurityToken;
ClaimsPrincipal cPrincipal = GetClaimsPrincipal(token, user);
var sesionToken = new SessionSecurityToken(cPrincipal)
{
IsReferenceMode = true,
IsPersistent = true
};
FederatedAuthentication.WSFederationAuthenticationModule.SetPrincipalAndWriteSessionToken(
sesionToken, true);
FederatedAuthentication.WSFederationAuthenticationModule.PersistentCookiesOnPassiveRedirects = true;
FederatedAuthentication.SessionAuthenticationModule.WriteSessionTokenToCookie(sesionToken);
I opened a chat room too http://chat.stackoverflow.com/rooms/77736/windows-identity-federation
Do I need to create a cookie manually? If that is the solution, which are the values that I need to store?
Can anybody tell me what is going wrong with this approach for single sing on?
I have a website A with the authentication logic inside. The user can select the role to access the portal that he wants to go. The problem is how can I configure properly those websites to redirect correctly, because when I redirect, I lose the token(redirect is a GET), I never had the cookie on the portal that I want to go. Do I am missing something in my implementation? Maybe a configuration on the portal that I want to redirect? I am not using the audienceUri on the webconfig, Is this related with the problem? I am using a service that gives me a token if the user is authenticated. Then with that token, I want to redirect the page to the corresponding portal.
Said that I will show you the Login Method in AccountController
My Proxy class looks like this
} And the base class of that one is the following:
}
Basically we are not using the default configuration for WS with the audienceUri and the federationConfiguration section, the equivalent would be:
I am attaching the link to stackoverflow too
http://stackoverflow.com/questions/30196008/how-can-i-configure-claim-authentication-in-a-separate-asp-net-mvc-authenticatio