Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Deploying ASP.NET Core 2.2 onto an IIS Server - Debugging and advice.

$
0
0

I deployed my test website onto a local IIS server by publishing it to a folder and making sure I had 'Windows Authentication' selected.

The page loads but my Authorisation policies are not working and I have no idea how to see why.

            services.AddAuthentication(IISDefaults.AuthenticationScheme);

            services.AddAuthorization(options =>

            {

                options.AddPolicy("Admin", policy =>

                    policy.Requirements.Add(new Check(newstring [] { "Admin" })));

                options.AddPolicy("User", policy =>

                    policy.Requirements.Add(new Check(newstring[] { "User" })));

            });            

            services.AddTransient<IClaimsTransformation, CustomClaimsTransformer>();

I can see that my user Claims were successful, and I can navigate to pages without a decorator, but I cannot see items with a

[Authorize(Policy = "Admin")] or [Authorize(Policy = "User")]

decorator.

I tried attaching the process to visual studio, but I don't get any messages. How do I debug a CORE 2.2 site when it is running on IIS?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>