Today's the day: new ASOS and OpenIddict packages (compatible with ASP.NET Core 1.0 and 2.0) have just been pushed to NuGet.org:
- AspNet.Security.OpenIdConnect.Server – 1.0.2 (for ASP.NET Core 1.x)
- AspNet.Security.OpenIdConnect.Server – 2.0.0-rc1-final (for ASP.NET Core 2.x)
- Owin.Security.OpenIdConnect.Server – 1.0.2 (for OWIN/Katana 3.x)
- Owin.Security.OpenIdConnect.Server – 2.0.0-rc1-final (for OWIN/Katana 4.x)
- OpenIddict – 1.0.0-rc1-final (for ASP.NET Core 1.x)
- OpenIddict – 2.0.0-rc1-final (for ASP.NET Core 2.x)
What's new?
In AspNet.Security.OpenIdConnect.Server and Owin.Security.OpenIdConnect.Server 1.0.2
- Calling
context.HandleResponse()
from theSerializeAuthorizationCode
,SerializeAccessToken
,SerializeIdentityToken
andSerializeRefreshToken
events no longer throws an exception if the authentication ticket is not explicitly set (c734c6f). - An invalid exception message mentioning OpenIddict was reworded (cd83912).
- The authorization code/access token/identity token/refresh token deserialization methods are no longer called twice for introspection and revocation requests that specify a
token_type_hint
that doesn't match the actual token type (c561a34). - A standard-compliant
Expires
HTTP header is now returned by the non-interactive ASOS endpoints (5af1d44). - New constants have been added to
OpenIdConnectConstants
(0980fb8) (461ecd4). - New events allowing to control the sign-in, sign-out and challenge operations have been introduced (d95810b) (3801427).
In AspNet.Security.OpenIdConnect.Server 2.0.0-rc1-final
OpenIdConnectServerProvider
can now be resolved from the DI container
Good news: OpenIdConnectServerProvider
can now be used with dependency injection thanks to a huge refactoring of the ASP.NET Core 2.0 authentication stack, that now implements the options-based pattern I recommended.
To use constructor-injected dependencies in your provider, you can ask ASOS to resolve the provider instance at request-time by setting the new OpenIdConnectServerOptions.ProviderType
option (which is a wrapper around AuthenticationSchemeOptions.EventsType
):
1 | public class AuthorizationProvider : OpenIdConnectServerProvider |
1 | public class Startup |
Such feature requires built-in support in the authentication stack and thus, is unfortunately not available in the OWIN/Katana version of ASOS 2.x.
In Owin.Security.OpenIdConnect.Server 2.0.0-rc1-final
The OWIN/Katana version of ASOS 2.x now requires targeting the Microsoft.Owin
4.0.0-alpha1
packages, which are natively compatible with IdentityModel 5.2.0-preview1 (unlike the previous iteration).
In OpenIddict 1.0.0-rc1-final and 2.0.0-rc1-final
OpenIddict 1.0.0-rc1-final/2.0.0-rc1-final is the first public version of OpenIddict. To learn more about the changes added since the first betas, don't hesitate to take a look at the GitHub repository.
What package(s) should I reference?
Depending on whether your application targets OWIN/Katana 1.x/2.x or ASP.NET Core 1.x/2.x, you'll need to reference different versions of the ASOS/OpenIddict packages as the authentication stack has been completely revamped in ASP.NET Core 2.0. For more information about these changes, read the Auth 2.0 Changes / Migration announcement on GitHub.
Your application uses the low-level OpenID Connect server handler (aka ASOS)
Your application is an ASP.NET Core 1.x/2.x project
ASP.NET Core version | Package name | Package version | Package description |
---|---|---|---|
1.x | AspNet.Security.OpenIdConnect.Server | 1.0.2 | Contains the OpenID Connect server middleware. |
2.x | AspNet.Security.OpenIdConnect.Server | 2.0.0-rc1-final | Contains the OpenID Connect server middleware. |
Your application is an OWIN/Katana (legacy ASP.NET) project
OWIN/Katana version | Package name | Package version | Package description |
---|---|---|---|
3.x | Owin.Security.OpenIdConnect.Server | 1.0.2 | Contains the OpenID Connect server middleware. |
4.x | Owin.Security.OpenIdConnect.Server | 2.0.0-rc1-final | Contains the OpenID Connect server middleware. |
Your application uses OpenIddict
ASP.NET Core version | Package name | Package version | Package description |
---|---|---|---|
1.x | OpenIddict | 1.0.0-rc1-final | Contains the OpenID Connect server component that is needed to handle OAuth 2.0 and OIDC requests. |
1.x | OpenIddict.EntityFramework | 1.0.0-rc1-final | Contains the Entity Framework 6.x stores (only compatible with .NET Framework 4.5.1). |
1.x | OpenIddict.EntityFrameworkCore | 1.0.0-rc1-final | Contains the Entity Framework Core stores. |
2.x | OpenIddict | 2.0.0-rc1-final | Contains the OpenID Connect server component that is needed to handle OAuth 2.0 and OIDC requests. |
2.x | OpenIddict.EntityFramework | 2.0.0-rc1-final | Contains the Entity Framework 6.x stores (only compatible with .NET Framework 4.6.1). |
2.x | OpenIddict.EntityFrameworkCore | 2.0.0-rc1-final | Contains the Entity Framework Core stores. |
When using OpenIddict, the appropriate ASOS version will be automatically chosen by NuGet: you don't need to explicitly reference the AspNet.Security.OpenIdConnect.Server
package.