I´ve created a multiple project solution with multiple sites on different sub domains on same server.
Before everything worked great with authentication but when I changed server it stopped working. I use domain="*.mydomain.com" in the authentication/forms-tag. When I changed to domain="mydomain.com" it works, but not with the wildcard. Have I missed something
in the configuration?
Ok. Strange that it worked on the old server. Perhaps it was a static machine key in the machine.config... Whatever. Everything works perfect now. Thank you!
Aimit
Member
11 Points
70 Posts
cross sub domain authentication gives 401 access error
Jul 04, 2012 09:05 AM|LINK
Hello!
I´ve created a multiple project solution with multiple sites on different sub domains on same server.
Before everything worked great with authentication but when I changed server it stopped working. I use domain="*.mydomain.com" in the authentication/forms-tag. When I changed to domain="mydomain.com" it works, but not with the wildcard. Have I missed something in the configuration?
BrockAllen
All-Star
28052 Points
4996 Posts
MVP
Re: cross sub domain authentication gives 401 access error
Jul 04, 2012 02:27 PM|LINK
The format of the domain attribute in config should be ".domain.com" -- notice no "*" and also notice "." at the begining.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
Aimit
Member
11 Points
70 Posts
Re: cross sub domain authentication gives 401 access error
Jul 04, 2012 02:53 PM|LINK
Thanks! This help me to make the log in work again at the main domain. But the problem is still there when I change to another subdomain.
BrockAllen
All-Star
28052 Points
4996 Posts
MVP
Re: cross sub domain authentication gives 401 access error
Jul 04, 2012 03:07 PM|LINK
Oh yes, so i forgot the other part :)
If you have more than one machine that is sharing the forms authentication cookie, you need to sync the <machineKey>. Here's some info on that.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
Aimit
Member
11 Points
70 Posts
Re: cross sub domain authentication gives 401 access error
Jul 05, 2012 09:14 AM|LINK
The problem is that I have only switched server. Everything is on the same server. No more options? :)
BrockAllen
All-Star
28052 Points
4996 Posts
MVP
Re: cross sub domain authentication gives 401 access error
Jul 05, 2012 01:32 PM|LINK
If there is more than one application on the one server you still need to configure the <machineKey> for each app.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
Aimit
Member
11 Points
70 Posts
Re: cross sub domain authentication gives 401 access error
Jul 05, 2012 02:11 PM|LINK
Ok. Strange that it worked on the old server. Perhaps it was a static machine key in the machine.config... Whatever. Everything works perfect now. Thank you!