dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.11k stars 9.91k forks source link

When using AddJwtBearer it can not read .well-known/openid-configuration if it contains an object #56852

Closed tehho closed 1 month ago

tehho commented 1 month ago

Is there an existing issue for this?

Describe the bug

Problem with Microsoft.AspNetCore.Authentication.JwtBearer 8.0.7 with Microsoft.IdentityModel.Protocols.OpenIdConnect 8.0.0 when reading well-known configurations with objects. Specifying Microsoft.IdentityModel.Protocols.OpenIdConnect 7.6.3 in csproj works like a charm.

Expected Behavior

More of a suggested fix: Clamp Microsoft.IdentityModel.Protocols.OpenIdConnect to [7.1.2, 8.0.0) while >=8.0.0 is broken

Steps To Reproduce

Standard AddJWTBearer pointing to a well-known with ex: mtls_endpoint_aliases before jwks_endpoints.

Exceptions (if any)

System.InvalidOperationException: Cannot redirect to the authorization endpoint, the configuration may be missing or invalid.

.NET Version

8.0.7

Anything else?

https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/2728

mkArtakMSFT commented 1 month ago

@jennyf19 sounds like something you have to tackle. I think we should close this one in favor to the issue in your repo.

mkArtakMSFT commented 1 month ago

Talked to @jennyf19. Closing this as a dupe of https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/2728.