Support Keycloak >= Version 18
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.
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.
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!
This fix is now available from NuGet.org in the 6.0.9 release.