0

Our asp.net website was working fine with ADFS SSO since we made a change in the session state cookie settings from "Use Cookies" to "USE URI". After making this change, fam.IsSignInResponse(request) is always false in the below code so that it redirects back to the ADFS login screen recursively.

public List<ClaimEntity> GetClaims()
        {
            logger.Info("Started executing GetClaims()");
            List<ClaimEntity> claims = new List<ClaimEntity>();
            // sam is configured in web.config
            var sam = FederatedAuthentication.SessionAuthenticationModule;
            logger.Info("Declaring sam");
            // fam is not
            var fam = new WSFederationAuthenticationModule();
            logger.Info("Declaring fam");
            //fam.FederationConfiguration = FederatedAuthentication.FederationConfiguration;
            fam.ServiceConfiguration = FederatedAuthentication.ServiceConfiguration;
            logger.Info("Assigning ServiceConfiguration to fam");
            var request = thisContext.Request;

            // is this the response from the STS
            if (!fam.IsSignInResponse(request))
            {
                // no
                logger.Info("fam.IsSignInResponse => No");
                // the STS
                fam.Issuer = _IssuerSTSSpec.Issuer;
                logger.Info("IssuerUrl= " + _IssuerSTSSpec.Issuer);
                // the return address
                fam.Realm = thisContext.Request.Url.AbsoluteUri;
                logger.Info("Assigning fam.Realm= " + thisContext.Request.Url.AbsoluteUri);
                logger.Info("Creating SignInRequest...");
                var req = fam.CreateSignInRequest(string.Empty, null, false);                
                logger.Info("Redirecting to the issuer...");
                logger.Info("Request to STS: "+ req.WriteQueryString().ToString());
                // go to STS
                thisContext.Response.Redirect(req.WriteQueryString());

            }
            else
            {
                // yes  
        -----------
        -----------

            }
            logger.Info("Returning the claims");
            return claims;
        }

Is "USE URI" session cookie mode is not supported with ADFS integrated application or any changes required in my code?

Sreekanth Mohan
  • 340
  • 4
  • 29

1 Answers1

0

It would help understand better if you add the example code of "Use URI". Is there really a need to use this method? Using cookies will keep the URL clean and it is more manageable. And if it is already working for you, you can go with it unless there is really need to use URI

soccer7
  • 3,547
  • 3
  • 29
  • 50