Earlier today, new OpenIddict packages were pushed to NuGet.org:
- OpenIddict – 1.0.0-rc2-final (for ASP.NET Core 1.x)
- OpenIddict – 2.0.0-rc2-final (for ASP.NET Core 2.x)
What's new?
Starting with RC2, using OpenIddict with third-party client applications (i.e applications you don't own and are managed by someone else) is officially supported. For that, new features – that were still work in progress in the previous iterations – have been added:
- A new application permissions feature was added, which allows controlling and limiting the features a client application can use. For instance, to allow a client application to use only the authorization code flow and the logout endpoint, the following permissions can be granted:
1 | await _applicationManager.CreateAsync(new OpenIddictApplicationDescriptor |
For more information about this feature, you can read the corresponding documentation.
- A new opt-in scope validation option was added. When it is enabled, OpenIddict automatically rejects authorization and token requests that specify unregistered scopes. Scopes can be registered statically using
options.RegisterScopes([list of authorized scopes])
or dynamically, usingOpenIddictScopeManager.CreateAsync()
:
1 | services.AddOpenIddict(options => |
1 | await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor |
- The introspection endpoint was updated to reject access tokens that don't have any audience (since OpenIddict can no longer assume all the registered applications are fully trusted). This change requires updating your code to explicitly attach a resource to your tokens.
1 | var ticket = new AuthenticationTicket( |
- New
OpenIddictScopeManager
methods have been introduced to allow associating resources (aka API audiences) with specific scopes and retrieving all the resources corresponding to a set of scopes:
1 | await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor |
1 | ticket.SetResources(await _scopeManager.ListResourcesAsync(scopes)); |
- New
OpenIddictAuthorizationManager
methods have been added to make authorizations easier to create or retrieve:
1 | // Create a new permanent authorization associated with |
1 | // Retrieve all the permanent and valid authorizations associated |
OpenIddictApplication.RedirectUris
,OpenIddictApplication.PostLogoutRedirectUris
andOpenIddictAuthorization.Scopes
are now serialized as JSON arrays in the database.
Migrate to OpenIddict RC2
Before updating your packages, read the migration guide. It explains how to add an Entity Framework Core migration to update the OpenIddict tables and includes a migration script to convert the RedirectUris
, PostLogoutRedirectUris
and Scopes
columns to the new JSON format.