Question

This should be simple but i dont know what i am missing.

I am using forms authentication across sub domains,

I have a parent domain, parent.com and two sub domains portal.parent.com and auth.parent.com. auth.parent.com is the authenticating site.

When an unautherized users access portal.parent.com/site, They will be redirected to auth.parent.com/Account/LogOn?ReturnUrl=%2fsite, after a successfull login they are redirected toauth.parent.com/site, and that the problem. I was expecting to be redirected back to portal.parent.com/site.

my configuration on boths sites

portal.parent.com/site web.config

<authentication mode="Forms">
  <forms loginUrl="http://auth.parent.com/Account/LogOn" enableCrossAppRedirects="true" domain=".parent.com" timeout="2880" />
</authentication>

auth.parent.com/site web.config

 <authentication mode="Forms">
  <forms loginUrl="~/Account/LogOn" enableCrossAppRedirects="true" domain=".parent.com" timeout="2880" />
</authentication>

other than the return url, the authentication is working fine, i.e If i go back to portal.parent.com/siteI can see the user authenticated and i can access the Identity info.

I was reading this question Forms Authentication across Sub-Domains

But didnt help specifically in my case.

Thanks

Was it helpful?

Solution

I got this Forms Authentication ReturnUrl and subdomain for single sign-on , That solved my problem.

I am not sure if that is the best way to do it, though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top