Cookie Authentication not working on ASP NET Core As IIS Subsite

I have a windows server with several application deployed as default website sub application:

enter image description here

One of this application (RiskturnStorm2) is a .Net Core Asp Net application with cookie authentication.

            services.AddAuthentication(Constants.AuthenticationSchema)              .AddCookie(Constants.AuthenticationSchema, config =>              {                  config.Cookie.Name = "UserLoginCookie";                  config.LoginPath = "/Login";              }); 

Launching the application on localhost works perfectly.

When i try to open the application from its domain (www.XXX.com/riskturnstorm2) the login redirect takes too much time and, eventually, an error page is displayed, as if the login page itself (which has [AllowAnonymous] attribute) performs another redirect to itself (generationg a loop).

enter image description here

If I try to deploy the application directly in the root of the default website everything works well (but this is not a valid solution for me).

Anyone can help? Could this be related to not-specifying the domain in the ASP NET cookie authentication declaration?

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.