AspNet.Security.OAuth.Providers icon indicating copy to clipboard operation
AspNet.Security.OAuth.Providers copied to clipboard

Support Keycloak >= Version 18

Open coding-pagro opened this issue 3 years ago • 2 comments

Keycloak changed their default url schema by removing the "auth" part of the url, which causes the Keycloak provider to break for any version >= 18. Currently the "auth" part is hardcoded. I think this suboptimal, even for older versions. I'm using also keycloak 16 behind a reverse proxy and somehow ended up configured also in a configuration, where "auth" is not part of the url.

I would suggest a additional, nullable property "Path" with the default value "auth" (for backwards compability). This would not only allow the Version 18 to work, but also other scenarios where Keycloak is hosted under a non out-of-the-box url.

coding-pagro avatar Jun 24 '22 07:06 coding-pagro

KeyCloak supports OpenID Connect discovery/OAuth 2.0 authorization server metadata so you'd get better results with either the MSFT OIDC handler or with the new OpenIddict client (https://kevinchalet.com/2022/06/22/openiddict-4-0-preview1-is-out/), that support dynamic configurations.

kevinchalet avatar Jun 24 '22 09:06 kevinchalet

KeyCloak supports OpenID Connect discovery/OAuth 2.0 authorization server metadata so you'd get better results with either the MSFT OIDC handler or with the new OpenIddict client (https://kevinchalet.com/2022/06/22/openiddict-4-0-preview1-is-out/), that support dynamic configurations.

Thank you for your comment. I did already successful use Keycloak with the AddOpenIdConnect extension from Microsoft. I just stumbled over AspNet.Security.OAuth.Providers as part of an example and I did no deep dive in comparing mechanism. But I will also take a look at OpenIddict!

coding-pagro avatar Jun 24 '22 09:06 coding-pagro

This fix is now available from NuGet.org in the 6.0.9 release.

martincostello avatar Aug 24 '22 07:08 martincostello