Sharing Authentication between ASP.NET sites

前端 未结 4 2064
再見小時候
再見小時候 2021-01-01 08:10

I have two ASP.NET sites (they can not run in the same process) and I need to share authentication between them. If a user is in site A already authenticated and then goes

4条回答
  •  难免孤独
    2021-01-01 08:34

    Are they in the same domain?

    If you have app1.blah.com and app2.blah.com, it's very easy to do. Just set the domain and the name to the same value in the forms-section in web.config:

    
          
        
    

    An added benefit is that users can sign into either site and will still be authenticated if they go to the other one.

提交回复
热议问题