Sichern Sie sich eine ASP.NET Core Blazor -Web -App mit Microsoft Entra IDC#

Ein Treffpunkt für C#-Programmierer
Guest
 Sichern Sie sich eine ASP.NET Core Blazor -Web -App mit Microsoft Entra ID

Post by Guest »

Ich habe mir Microsofts Beispiel „Secure an ASP.NET Core Blazor Web App with Microsoft Entra ID“ / GitHub angesehen.
In program.cs ist die Authentifizierung wie folgt konfiguriert.

Code: Select all

builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(builder.Configuration.GetSection("AzureAd"));
builder.Services.AddAuthorization();
Wenn ich mich anmelde und auf die Wetterschaltfläche klicke, wird ein Cookie an die Anfrage angehängt.
Ich verstehe nicht, woher dieses Cookie kommt aus. Ich habe eine Blazor-Web-App von Grund auf mit der gleichen Konfiguration erstellt, aber die Authentifizierung funktioniert nicht. Ich kann auch keine Dokumentation finden. Wie funktioniert dieses Beispiel?
Image

Image

Image

Update:
Das Beispiel ruft die API auf HostEnvironment.BaseAddress auf. In meinem Fall rufe ich eine WebApi (anderes Projekt) mit einem anderen Port auf. Was muss ich konfigurieren, damit das Cookie auch angehängt wird?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post