Loading ...

SSO: Unable to redirect to cross domain after authentication | CodeAsp.Net

SSO: Unable to redirect to cross domain after authentication

 /5
0 (0votes)

While working with SSO today I was facing one issue where I was unable to get a redirect to cross domain. I was having two sites abc.com and sub.abc.com. "sub.abc.com" was using the cookie created from abc.com i.e the parent site. This was the login link in my child site : 

http://abc.com/login?ReturnURL=http://sub.abc.com/default.aspx

The expected result was that when user logs in via parent site he should be redirected to the url as mentioned in ReturnURL part. The issue which was occuring in my case was that after login in the parent site it was getting redirected to http://abc.com/default.aspx instead of http://sub.abc.com/default.aspx . After searching some internals on FormAuthentication I got the solution. The fix was to set the enableCrossAppRedirects property to true in form tag of the parent site's web config.

<authentication mode="Forms">
        <forms loginUrl="login.aspx" domain="abc.com" 
enableCrossAppRedirects="true" />
    </authentication>


 

Comments (no comments yet)

Top Posts