-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: createLinkedInOAuthConfig()
#287
base: main
Are you sure you want to change the base?
Conversation
lib/create_linkedin_oauth_config.ts
Outdated
return { | ||
clientId, | ||
clientSecret, | ||
authorizationEndpointUri: "https://www.linkedin.com/oauth/v2/authorization", | ||
tokenUri: "https://www.linkedin.com/oauth/v2/accessToken", | ||
redirectUri: config.redirectUri, | ||
defaults: { | ||
requestOptions: { | ||
body: { | ||
client_id: clientId, | ||
client_secret: clientSecret, | ||
}, | ||
}, | ||
scope: config.scope, | ||
}, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't get access toke with this settings. https://www.linkedin.com/oauth/v2/accessToken
seems returning invalid_client
error.
Error: Client authentication failed
at AuthorizationCodeGrant.getTokenResponseError (https://deno.land/x/oauth2_client@v1.0.2/src/grant_base.ts:156:14)
at eventLoopTick (ext:core/01_core.js:182:7)
at async AuthorizationCodeGrant.parseTokenResponse (https://deno.land/x/oauth2_client@v1.0.2/src/grant_base.ts:72:13)
at async handleCallback (file:///Users/kt3k/denoland/deno_kv_oauth/lib/handle_callback.ts:69:18)
at async handler (file:///Users/kt3k/denoland/deno_kv_oauth/server.ts:22:28)
at async ext:deno_http/00_serve.js:460:18 {
error: "invalid_client",
errorDescription: "Client authentication failed",
errorUri: undefined,
state: undefined
}
Could you please show me your test source code? |
Edit: Nevermind. We're getting a |
@iuioiua @kt3k i figured out the bug since i am working on this too. We could implement a bool that allows to disable to set the setting:
works like a charm any plans on how to implement this nicely into this lib? i can do the work |
Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Thanks for the insight, @breuerfelix. I've adjusted this to make it work, but I'm not yet convinced it's the right way to go, as it seems hacky. Are you able to test now? |
@iuioiua thanks for the fast reply! yesterday i googled long time how to consume a module from github and it seems like... it doesn't work ... any idea how i can easily use your fork for testing? yes it seems hacky. another idea would be to add a new key called |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #287 +/- ##
==========================================
- Coverage 99.15% 98.60% -0.55%
==========================================
Files 22 23 +1
Lines 475 503 +28
Branches 24 25 +1
==========================================
+ Hits 471 496 +25
- Misses 2 4 +2
- Partials 2 3 +1 ☔ View full report in Codecov by Sentry. |
I'd prefer not to do that either. @cmd-johnson, is there a way we override the |
Well i mean how can i use your branch as a deno package in my application instead of the upstream package? Can i do some override of the package in
The problem is that, using the codeVerifier (which is the state i guess) is a good thing to do since it prevents man in the middle attacks. We just shouldn't pass it in the last step (for linkedIn). |
Yes. Replace Deno KV OAuth's import specifier with https://raw.githubusercontent.com/denoland/deno_kv_oauth/linkedin/mod.ts. |
Not yet tested.
Closes #282
Closes #285