• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1114
  • Last Modified:

Authenticate to all subdomains using ASP.NET forms authentication

Hello Experts,

I am looking for help in understanding how to authenticate users to all subdomains of a domain using forms authentication.  I have a toplevel domain.com which allows anonymous access to most of the site (I have a secured directory that requires login) and provides an asp.net login control.   All this is working fine.

However, I need to allow users to login using the login control at the top-level domain and be authenticated (and redirected) to a subdomain: sub.domain.com.  I have set up the subdomain to be secure and it is working as expected.  How can I allow users who sign in to the top-level be authenticated to the subdomain as well.  FYI - both domains are hosted on the same server.

Thanks for any help.  
1 Solution
soapygusAuthor Commented:
Great post! I am really grateful.

I used scenario 3 and created the FormsAuthenticationticket with a 'domain' level cookie inside of the Login_Click event.  

I also had to place identical machinekey value in the web.config files of the top and sub domain.

Worked as explained.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now