Update the migration guide

This commit is contained in:
Kévin Chalet 2021-06-22 14:35:04 +02:00
parent 0fa393b6f6
commit d76b5d4686

View File

@ -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