1

In windows authentication without subdomain http://localhost/myweb/ its asking username/password after successful its displaying application page.

But when I ran with subdomain http://abc.localhost/myweb/ its not taking the login credentials, Its giving Unauthorized access error. what changes I need to do to overcome this problem.

what I tried is: in Web.config I changed allow users to * and deny users to ? but its not working

Masoud Keshavarz
  • 2,166
  • 9
  • 36
  • 48
Ravi KK
  • 11
  • 2

1 Answers1

0

Its because the cookie is change and depended on the subdomain and domain - to make it keep the same cookie you have to define the domain parameter on the authentication lines and on cookie on web.config

The lines that you have to define it are...

<authentication mode="Forms">
  <forms domain="domain.com"  .... />
</authentication>
<roleManager domain="domain.com" >
     .... other lines .....
</roleManager>
<httpCookies domain="domain.com" .... />

Setting up the correct domain with out subdomain you can have the same authenticated cookie on your subdomains

Other similar questions : Multiple applications using same login database logging each other out

Aristos
  • 66,005
  • 16
  • 114
  • 150