Multiple & SubDomain's cookie in asp.net Core Identity

前端 未结 4 1633
情深已故
情深已故 2020-12-03 18:24

I have a webpage which uses multiple URLS for the same application:

for example: *.MyWebPage.com.au *.YourWebPage.com.au

So it will use subdomains on

4条回答
  •  没有蜡笔的小新
    2020-12-03 19:03

    How many main domains are there? If there are not too many, you can add several CookieAuthenticationOptions. Like this:

            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationScheme = "mywebpage.com.au",
                CookieDomain = "mywebpage.com.au",
            });
            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationScheme = "yourwebpage.com.au",
                CookieDomain = "yourwebpage.com.au",
            });
    

    If there are too many main domains, you will need to write your own cookie provider.

提交回复
热议问题