I have multiple sub-domains that use forms authentication. Once a user logs in, they are fine going to any of the other sub-domains.
Here is my problem: If I go to reporting.example.com/reporting.aspx, I get redirected to login.example.com/login.aspx. After entering my credentials, I get redirected to login.example.com/reporting.aspx, which doesn't exist.
I have a work around but I would like to know if there is a cleaner way. What I do currently is set the loginUrl attribute of the forms element of the reporting.example.com to be login.example.com/login.aspx?domain=reporting.example.com.
Then, in the login.aspx code, a开发者_开发知识库fter I've authenticated and set the cookie, I look to see if there was a domain variable passed in to the URL. If so, I prepend the returnUrl with the domain and do a simple redirect.
It works, but it feels klugey. Any ideas?
Does the ReturnURL contain the full url? If so it should work as expected..
Make sure you have EnableCrossAppRedirects set to true in your web.config.
精彩评论