You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary
The getAuthorizationUrl function does not take into account the code_challenges_supported for OIDC providers.
Details
The code block here initializes a local variable as that gets assigned to instead of the as at the outer scope, defined here. This means that the check for as.code_challenges_supported will never execute here.
How to reproduce
Import MicrosoftEntraId provider.
Set clientId, clientSecret, tenantId.
Login with MicrosoftEntraId.
It works, but it shouldn't.
Microsoft Entra's OIDC discovery endpoint does not return a code_challenges_supported array, but it's supposed to return ['pkce'] because it's actually required.
Expected behavior
If the code logic is correct, then Microsoft Entra should actually throw an error upon login, because they do not return code_challenges_supported from their discovery endpoint, despite requiring it to login.
Ideally, both scenarios could co-exist - Microsoft Entra's discovery endpoint not matching the specification, but Auth.js still being able to handle the edge case somehow.
I think my solution would be to provide an authorizationServer to the OIDC config, where settings can be provided manually to "patch" non-compliant discovery endpoints.
The text was updated successfully, but these errors were encountered:
ap0nia
added
bug
Something isn't working
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
labels
Oct 4, 2024
Environment
N/A
Reproduction URL
https://github.com/ap0nia/next-auth
Describe the issue
Summary
The getAuthorizationUrl function does not take into account the code_challenges_supported for OIDC providers.
Details
The code block here initializes a local variable as that gets assigned to instead of the as at the outer scope, defined here. This means that the check for as.code_challenges_supported will never execute here.
How to reproduce
Microsoft Entra's OIDC discovery endpoint does not return a
code_challenges_supported
array, but it's supposed to return['pkce']
because it's actually required.Expected behavior
If the code logic is correct, then Microsoft Entra should actually throw an error upon login, because they do not return code_challenges_supported from their discovery endpoint, despite requiring it to login.
Ideally, both scenarios could co-exist - Microsoft Entra's discovery endpoint not matching the specification, but Auth.js still being able to handle the edge case somehow.
I think my solution would be to provide an authorizationServer to the OIDC config, where settings can be provided manually to "patch" non-compliant discovery endpoints.
The text was updated successfully, but these errors were encountered: