Now using v2 endpoints (passing the code_challenge and the code_challenge_method to retrieve the authorization token https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow). Fusionauth Microsoft OpenIDConnect provider returns the next error:
Request to the [https://login.microsoftonline.com/<tenant-id>/oauth2/token] endpoint failed. Status code [400].
Error response is
{
"error" : "invalid_grant",
"error_description" : "AADSTS50148: The code_verifier does not match the code_challenge supplied in the authorization request for PKCE.\r\nTrace ID: c0836075-1551-45ad-9fce-9b7a7716d201\r\nCorrelation ID: 16f33aed-50eb-461a-9740-66299e56fe58\r\nTimestamp: 2022-05-12 15:57:26Z",
"error_codes" : [ 50148 ],
"timestamp" : "2022-05-12 15:57:26Z",
"trace_id" : "c0836075-1551-45ad-9fce-9b7a7716d201",
"correlation_id" : "16f33aed-50eb-461a-9740-66299e56fe58",
"error_uri" : "https://login.microsoftonline.com/error?code=50148"
}
I assume that this is because there is no way to pass this challenge code. Also i Notice that the url used by fusionauth
to get the token is a v1
endpoint https://login.microsoftonline.com/<tenant-id>/oauth2/token
. So i ask again, is there a way to use v2
endpoints and code_challenge
to complete the login flow for Microsoft OpenIdConnect providers?