Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: what if token_type is not always available #37

Open
pixeleet opened this issue Aug 4, 2023 · 4 comments
Open

Question: what if token_type is not always available #37

pixeleet opened this issue Aug 4, 2023 · 4 comments

Comments

@pixeleet
Copy link

pixeleet commented Aug 4, 2023

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#response

Thus the getToken flow is erroring out.
https://github.com/cmd-johnson/deno-oauth2-client/blob/master/src/grant_base.ts#L99-L104

@cmd-johnson
Copy link
Owner

Ugh, I just love how hard it seems to be for authorization servers to properly implement the OAuth2 standard 😅

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.

@pixeleet
Copy link
Author

pixeleet commented Aug 4, 2023

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?

@pixeleet pixeleet changed the title Bug: token_type is not always available Question: what if token_type is not always available Aug 4, 2023
@pixeleet
Copy link
Author

pixeleet commented Aug 4, 2023

Let the title represent it's LinkedIn's bug not the library's and we're questioning the problem to achieve a solution.

@iuioiua
Copy link
Contributor

iuioiua commented Jan 22, 2024

We've run into this issue in denoland/deno_kv_oauth#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: nextauthjs/next-auth#8831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants