-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Closed
Description
Description
Per offline discussion, we're just going to add a section to the article, not actually adopt app settings config in the sample apps.
NOTE: Add a section on TokenValidationParameters.IssuerValidator.
The following app settings config is ✨ automagically ✨ picked up. No need to adjust anything in the Program file.
BlazorWebAppOidc/BlazorWebAppOidcServer/BlazorWebAppOidcBff:
"Authentication": {
"Schemes": {
"MicrosoftOidc": {
"Authority": "https://login.microsoftonline.com/{TENANT ID (BLAZOR APP)}/v2.0/",
"ClientId": "{CLIENT ID (BLAZOR APP)}",
"CallbackPath": "/signin-oidc",
"SignedOutCallbackPath": "/signout-callback-oidc",
"RemoteSignOutPath": "/signout-oidc",
"SignedOutRedirectUri": "/",
"Scope": [
"openid",
"profile",
"offline_access",
"{APP ID URI (WEB API)}/Weather.Get"
]
}
}
},Remove the following lines from the Program file ...
- oidcOptions.Scope.Add(OpenIdConnectScope.OpenIdProfile);
- oidcOptions.Scope.Add("{APP ID URI}/Weather.Get");
- oidcOptions.CallbackPath = new PathString("/signin-oidc");
- oidcOptions.SignedOutCallbackPath = new PathString("/signout-callback-oidc");
- oidcOptions.RemoteSignOutPath = new PathString("/signout-oidc");
- oidcOptions.Authority = "https://login.microsoftonline.com/{TENANT ID}/v2.0/";
- oidcOptions.ClientId = "{CLIENT ID}";In the ConfigureCookieOidc method of CookieOidcServiceCollectionExtensions.cs, remove ...
- oidcOptions.Scope.Add(OpenIdConnectScope.OfflineAccess);MinimalApiJwt project:
"Authentication": {
"Schemes": {
"Bearer": {
"Authority": "https://sts.windows.net/{TENANT ID (WEB API)}/",
"ValidAudiences": [ "{APP ID URI (WEB API)}" ]
}
}
},Remove the following lines from the Program file ...
- jwtOptions.Authority = "{AUTHORITY}";
- jwtOptions.Audience = "{AUDIENCE}";Page URL
Content source URL
Document ID
c3346d3a-346b-8db4-2650-ec044b3f0dd9
Platform Id
1dd51a4e-f734-569f-f6e9-19a27bcd9f4d
Article author
Metadata
- ID: c3346d3a-346b-8db4-2650-ec044b3f0dd9
- PlatformId: 1dd51a4e-f734-569f-f6e9-19a27bcd9f4d
- Service: aspnet-core
- Sub-service: blazor
Metadata
Metadata
Assignees
Type
Projects
Status
Done