Closed kevingorski closed 8 months ago
Hi Kevin, you're configuration looks correct. I believe that this is a non-standard requirement. I've drafted a quick fix. Please let me know if it works.
https://raw.githubusercontent.com/denoland/deno_kv_oauth/handle-callback-request-options/mod.ts
handleCallback()
with the following structure:
{
requestOptions: {
urlParams: {
client_id: getRequiredEnv("LINKED_IN_CLIENT_ID"),
client_secret: getRequiredEnv("LINKED_IN_CLIENT_SECRET"),
redirect_uri: `${SITE_BASE_URL}/linkedInCallback`,
},
},
}
Thanks for the quick response!
I tried it with both requestOptions: { urlParams: { ... } }
and with requestOptions: { body: { ... } }
as the third param to handleCallback
and I get the same error message with the updated path for handleCallback
:
Error: A required parameter "client_id" is missing
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:181:11)
at async AuthorizationCodeGrant.parseTokenResponse (https://deno.land/x/oauth2_client@v1.0.2/src/grant_base.ts:72:13)
at async handleCallback (https://raw.githubusercontent.com/denoland/deno_kv_oauth/handle-callback-request-options/lib/handle_callback.ts:71:18)
If it helps, here's the code I'm working with.
Good thinking trying requestOptions: { body: { ... } }
. But I thought that would've worked. The best course of action is to add a pre-built OAuth config for LinkedIn as part of this library (we'd need it sooner or later anyway). Then, troubleshooting can be boiled down to only a few moving parts. I'm happy to do this if no one grabs it up.
As I noted in the related PR, I'm able to set up the custom config so I no longer run into the "client_id is missing" error even without the handleCallback
change, (now I've got a different and opaque error from LinkedIn that I can't yet troubleshoot) so feel free to close this whenever.
I'll close this issue for now but will still pursue #287, as it'll hopefully prevent issues relating to LinkedIn from popping up in the future. Thank you, Kevin!
I'm not sure if this is properly for this repo or
oauth2_client
, but please let me know if that's the case.I created an app in the LinkedIn developer portal, used the ID/secret locally and was able to go through the auth flow on LI (which leads me to believe the client id is set correctly on my end), but when handling the access token response I get the error in the title (and at the end of this issue).
LinkedIn's OAuth docs say to include the client ID and secret again in the call to get the access token – I'm not sure if that's non-standard?
Here is my client config:
Relevant part of the stack trace: