Open gabrielittner opened 6 years ago
It's been a while since I've tested the Microsoft integration, let me try it out and I'll get back to you.
Microsoft seem to be returning an invalid response for the access code exchange request, which is missing the token_type
field (which is mandatory, according to the OAuth2 spec). It's possible that the endpoints I'm using in this demo have changed; I'll compare it to the Microsoft docs.
When I tried to integrate Microsoft sign in to my app I was following this documentation. The documented response seems to be spec compliant.
The two differences to your implementation are that the client secret isn't required anymore and that they support redirects with custom schemes (the default when adding a native app in the console is msal[clientid]://auth
). Both won't fix the incomplete response though.
Yeah, I'm also looking at this documentation and the documented response there is spec compliant, but doesn't match what we're actually seeing - we only get a refresh_token
and and id_token
in the response, with no access_token
. The absence of the access_token
would explain why no token_type
is described in the response, so perhaps I should be a little more tolerant of that, though the response is definitely not compliant with the OAuth2 spec.
I'll see if any of my contacts at Microsoft can help explain the change in behavior.
This is a known issue in which Microsoft currently has an incomplete OpenID Connect implementation. I'll plan to let you know once the issue has been addressed. Thanks for writing about this.
BTW, @gabrielittner - what was the path to the .well-known/openid-configuration document you were using when you experienced the problem?
https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration
I've also tried using https://login.microsoftonline.com/common/oauth2/v2.0/authorize
and /token
directly without the discovery.
@selfissued When requesting Microsoft Graph scopes it seems to work now, but when using scopes for the Outlook API like https://outlook.office.com/calendars.readwrite.shared
instead of Calendars.ReadWrite.Shared
I'm still seeing the issue.
When using the Microsoft sign in I'm getting a "Token refresh failed" snackbar. The AuthorizationException looks like this
Does this also happen for you?