mirror of
https://gitee.com/dcren/openiddict-documentation.git
synced 2025-04-05 17:38:03 +08:00
Update the migration guide
This commit is contained in:
parent
0fa393b6f6
commit
d76b5d4686
@ -103,6 +103,21 @@ consider moving to `System.Text.Json` when migrating to OpenIddict 3.0, as 3.0 n
|
||||
In most cases, this should be as simple as replacing `JsonConvert.SerializeObject()`/`JsonConvert.DeserializeObject()`
|
||||
by their `System.Text.Json` equivalent: `JsonSerializer.Serialize()`/`JsonSerializer.Deserialize()`.
|
||||
|
||||
## Replace calls to the `AuthenticationTicket` extensions by their new `ClaimsPrincipal` equivalent:
|
||||
|
||||
OpenIddict 3.0 no longer uses the `AuthenticationTicket` type provided by ASP.NET Core. Instead, everything is now stored in the `ClaimsPrincipal` instance.
|
||||
If you have calls like `ticket.SetScopes()` or `ticket.SetResources()`, use their new equivalents (e.g `principal.SetScopes()` or `principal.SetResources()`).
|
||||
|
||||
## Use the new authentication schemes
|
||||
|
||||
In 3.0, the constants used as the ASP.NET Core authentication schemes have changed:
|
||||
|
||||
| Old constant name | New constant name (ASP.NET Core host) |
|
||||
|---------------------------------------------------|-------------------------------------------------------------|
|
||||
| OpenIddictServerDefaults.AuthenticationScheme | OpenIddictServerAspNetCoreDefaults.AuthenticationScheme |
|
||||
| OpenIddictValidationDefaults.AuthenticationScheme | OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme |
|
||||
| OAuthValidationDefaults.AuthenticationScheme | OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme |
|
||||
|
||||
## Update your application to work with the new `scope` format
|
||||
|
||||
In OpenIddict 3.0, the format of the `scope` claim used in JWT tokens has changed from a JSON array to a single space-separated claim to match
|
||||
|
Loading…
Reference in New Issue
Block a user