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

v1.5+ Breaks OAuth2Strategy callback #155

Open
Number16BusShelter opened this issue Feb 1, 2022 · 3 comments
Open

v1.5+ Breaks OAuth2Strategy callback #155

Number16BusShelter opened this issue Feb 1, 2022 · 3 comments

Comments

@Number16BusShelter
Copy link

After upgrading all modules I found out that OAuth2Strategy callback just did't fire.

I've created this issue at StackOverflow

After downgrading to 1.5.0 from 1.6.1 the problem is completely gone.

Please, provide some more info on this problem and how to resolve it.

Regards

@iohansson
Copy link

@Number16BusShelter I had a similar issue. I've tried downgrading to 1.5.0 like you suggest but that didn't help.
Found this nodejs/node#42116 issue in the node repo, downgraded to 16.3.0 and it worked like a charm without any errors. I'm using ESM and apparently they broke something in 16.4+.
Of course, downgrading node is not the best option, I'll investigate further when I have time.

@lcdss
Copy link

lcdss commented Jul 21, 2022

I had a similar problem this week after upgrading to node v18, where this strategy stopped working. I spent a few hours until I tried v16 and the authentication start working again.

The error is the following:

InternalOAuthError: Failed to obtain access token
    at OAuth2Strategy._createOAuthError (/mnt/Shared/Code/my-project/api/node_modules/passport-oauth2/lib/strategy.js:423:17)
    at /mnt/Shared/Code/my-project/api/node_modules/passport-oauth2/lib/strategy.js:177:45
    at /mnt/Shared/Code/my-project/api/node_modules/oauth/lib/oauth2.js:191:18
    at ClientRequest.<anonymous> (/mnt/Shared/Code/my-project/api/node_modules/oauth/lib/oauth2.js:162:5)
    at ClientRequest.emit (node:events:537:28)
    at ClientRequest.emit (node:domain:482:12)
    at Socket.socketErrorListener (node:_http_client:465:9)
    at Socket.emit (node:events:537:28)
    at Socket.emit (node:domain:482:12)
    at emitErrorNT (node:internal/streams/destroy:151:8) {
  oauthError: Error: connect ECONNREFUSED ::1:8000
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1237:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '::1',
    port: 8000
  }
}

At http://localhost:8000 was the oauth2 server (Laravel Passport).

@hdmr25
Copy link

hdmr25 commented Aug 22, 2022

Hi, i have the same problem, i use v16.14.0 and the oauth library with 0.9.15.
Is the problem also related to the version or are there any update
and would a downgrade of the version help?

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

4 participants