cmd-johnson / deno-oauth2-client

Minimalistic OAuth 2.0 client for Deno.
MIT License
45 stars 9 forks source link

OAuth2Strategy requires a clientID option #34

Closed adoublef closed 1 year ago

adoublef commented 1 year ago

I am unsur3 why I am getting the following error. This is occuring in the callback. The clientId is being set hardcoded and passes the initial signin so unsure why. I am using Auth0

[uncaught application error]: Error - OAuth2Strategy requires a clientID option

request: {
  url: "http://localhost:8000/callback?error=server_error&error_description=OAuth2Strategy%20requires%20a%20"... 17 more characters,
  method: "GET",
  hasBody: false
}
response: { status: 404, type: undefined, hasBody: false, writable: true }

    at Function.fromURLSearchParams (https://deno.land/x/oauth2_client@v1.0.2/src/errors.ts:55:12)
    at AuthorizationCodeGrant.validateAuthorizationResponse (https://deno.land/x/oauth2_client@v1.0.2/src/authorization_code_grant.ts:181:33)
    at AuthorizationCodeGrant.getToken (https://deno.land/x/oauth2_client@v1.0.2/src/authorization_code_grant.ts:139:34)
    at file:///home/adoublef/github.com/adoublef-js/oak-auth0/main.ts:42:44
    at dispatch (https://deno.land/x/oak@v12.1.0/middleware.ts:41:13)
    at https://deno.land/x/oak@v12.1.0/router.ts:1232:20
    at dispatch (https://deno.land/x/oak@v12.1.0/middleware.ts:41:13)
    at composedMiddleware (https://deno.land/x/oak@v12.1.0/middleware.ts:44:12)
    at dispatch (https://deno.land/x/oak@v12.1.0/router.ts:1238:22)
    at dispatch (https://deno.land/x/oak@v12.1.0/middleware.ts:41:13)
cmd-johnson commented 1 year ago

Seeing that this is an error returned by the Authorization Server after the initial redirect from your app to the Authorization Server's authorization endpoint, the error probably lies in that redirect.

You can check the network tab of your browser to find that initial redirect and take a look at the request parameters that were sent along with it. If it doesn't include a client_id, there's probably something wrong with your config.

adoublef commented 1 year ago

Thank you, I have resolved this one so will close. The issue was with the social connection not being setup properly