Open pixeleet opened 11 months ago
Ugh, I just love how hard it seems to be for authorization servers to properly implement the OAuth2 standard :sweat_smile:
The OAuth2 spec requires the token response to have this field, so this is technically a bug on LinkedIn's side.
Still, I'm aware that there's a lot of implementations out there that don't follow the spec and I'll try to come up with a way to account for these discrepancies that doesn't require everyone to reinvent the wheel in the process.
Tbh I haven't managed to auth with an OAuth based service yet that didn't use a Bearer
token.
Would it be safe to default token_type
to Bearer
if not present?
Let the title represent it's LinkedIn's bug not the library's and we're questioning the problem to achieve a solution.
We've run into this issue in https://github.com/denoland/deno_kv_oauth/pull/287. @cmd-johnson, is there any workaround?
Edit: Nevermind. We're getting a Client authentication failed
error. It appears to be yet another bug on LinkedIn's side: https://github.com/nextauthjs/next-auth/issues/8831
E.g. LinkedIn OAuth doesn't send the
token_type
in the response. https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?tabs=HTTPS1#responseThus the getToken flow is erroring out. https://github.com/cmd-johnson/deno-oauth2-client/blob/master/src/grant_base.ts#L99-L104