Authenticate to all subdomains using ASP.NET forms authentication

Posted on 2009-02-14
Last Modified: 2013-11-26
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 which allows anonymous access to most of the site (I have a secured directory that requires login) and provides an 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:  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.  
Question by:soapygus
    LVL 15

    Accepted Solution


    Author Comment

    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

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now