admin管理员组

文章数量:1191356

I've checked out Microsofts Secure an ASP.NET Core Blazor Web App with Microsoft Entra ID example / GitHub

In program.cs authentication is configured as follows.

builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
    .AddMicrosoftIdentityWebApp(builder.Configuration.GetSection("AzureAd"));
builder.Services.AddAuthorization();

If I log in and click on the weather button a cookie is attached to the request.

I don't understand where that cookie is coming from. I built a blazor web app from scratch with basically the same configuration but I can't get the authentication to work. I can't find any documentation either. How does this example work?

Update: The example is calling the API on HostEnvironment.BaseAddress. In my case I'm calling a WebApi (other project) with another port. What do I need to configure that the cookie is also attached?

本文标签: cSecure an ASPNET Core Blazor Web App with Microsoft Entra IDStack Overflow