You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -136,3 +136,64 @@ public class WeatherForecastService
136
136
}
137
137
}
138
138
```
139
+
140
+
## Use Open ID Connect (OIDC) v2.0 endpoints
141
+
142
+
The authentication library and Blazor templates use Open ID Connect (OIDC) v1.0 endpoints. To use a v2.0 endpoint, configure the <xref:Microsoft.AspNetCore.Builder.OpenIdConnectOptions.Authority?displayProperty=nameWithType> option in the <xref:Microsoft.AspNetCore.Builder.OpenIdConnectOptions>:
For more information, see [Scopes, notresources](/azure/active-directory/azuread-dev/azure-ad-endpoint-comparison#scopes-not-resources) intheAzuredocumentation.
@@ -818,3 +818,31 @@ While this approach requires an extra network hop through the server to call a t
818
818
819
819
* The server can store refresh tokens and ensure that the app doesn't lose access to third-party resources.
820
820
* The app can't leak access tokens from the server that might contain more sensitive permissions.
821
+
822
+
## Use Open ID Connect (OIDC) v2.0 endpoints
823
+
824
+
The authentication library and Blazor templates use Open ID Connect (OIDC) v1.0 endpoints. To use a v2.0 endpoint, configure the JWT Bearer <xref:Microsoft.AspNetCore.Builder.JwtBearerOptions.Authority?displayProperty=nameWithType> option. In the following example, AAD is configured for v2.0 by appending a `v2.0` segment to the `Authority` property:
825
+
826
+
```csharp
827
+
builder.Services.Configure<JwtBearerOptions>(
828
+
AzureADDefaults.JwtBearerAuthenticationScheme,
829
+
options=>
830
+
{
831
+
options.Authority+="/v2.0";
832
+
});
833
+
```
834
+
835
+
Alternatively, the setting can be made in the app settings (*appsettings.json*) file:
If tacking on a segment to the authority isn't appropriate for the app's OIDC provider, such as with non-AAD providers, set the `Authority` property directly. Either set the property in `JwtBearerOptions` or in the app settings file with the `Authority` key.
847
+
848
+
The list of claims in the ID token changes for v2.0 endpoints. For more information, see [Why update to Microsoft identity platform (v2.0)?](/azure/active-directory/azuread-dev/azure-ad-endpoint-comparison).
0 commit comments