OAuth Examples with MSAL
Eine neue WebApp mit Multi-Authentisierung erstellen:
dotnet new webapp -o AppName -au Individual -uld
Die App starten und den Register
Button klicken. Es wird ein Fehler geworfen, die Datenbank muss migriert werden.
Nach der Migration können wir den Code anpassen, um unsere Authentisierungsoptionen hinzuzufügen.
Für AzureAD muss in der App Registrierung als RedirectUri
Als Logout-URI
https://localhost:IIS-SSL-Port/signout-oidc eingetragen werden.
Im Code müssen wir außerdem das Cookie-Scheme anpassen:
.AddAzureAD(options => { Configuration.Bind("Authentication:AzureAd", options); options.CookieSchemeName = IdentityConstants.ExternalScheme; })
Microsoft-Sign-In
Login-Einschränkungen nach Schema
Web-App Sign-In Konfigurationsdatei
Microsoft Identity Platform
https://docs.microsoft.com/de-de/azure/active-directory/develop/sample-v2-code
Microsoft Authentication Flows
Single-Page Application
https://docs.microsoft.com/de-de/azure/active-directory/develop/scenario-spa-overview
Labs