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

Request timed out error while using Cognito provider #8627

Closed
itsevon opened this issue Sep 17, 2023 · 4 comments
Closed

Request timed out error while using Cognito provider #8627

itsevon opened this issue Sep 17, 2023 · 4 comments
Labels
providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@itsevon
Copy link

itsevon commented Sep 17, 2023

Provider type

Cognito

Environment

System:
OS: Windows 10 10.0.22621
CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
Memory: 3.56 GB / 15.78 GB
Binaries:
Node: 20.6.1 - C:\Program Files\nodejs\node.EXE
npm: 9.6.6 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 116.0.5845.188
Edge: Spartan (44.22621.2283.0), Chromium (117.0.2045.31)
Internet Explorer: 11.0.22621.1


"dependencies": {
"@types/node": "20.6.2",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.15",
"eslint": "8.49.0",
"eslint-config-next": "13.4.19",
"next": "13.4.19",
"next-auth": "^4.23.1",
"postcss": "8.4.29",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.3",
"typescript": "5.2.2"
}

Reproduction URL

https://github.com/itsevon/eleck-web.git

Describe the issue

After following the docs for NextAuth and Cognito Provider, after I click Sign In with Cognito button it just keeps showing the "Try to sign in with different account" alert.
chrome_sAJCB9t5Qq

And this is the error message I get
Code_l8UK6SvtJr

After reading some similar timeout issues
What I've tried:

  1. Wifi restart
  2. using personal mobile data
  3. laptop restart
  4. changed timeout in nextauthoptions
  5. Upgrade Node to v20x.

But no luck so far.

How to reproduce

  1. Click sign in button
  2. Click sign in with cognito button

Expected behavior

Pop up this window for you to type credentials
chrome_uSFp2xrgbC

@itsevon itsevon added providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Sep 17, 2023
@balazsorban44
Copy link
Member

There is a semi-hidden provider option added in: #3287

It's not well documented, as it should barely be needed. A bigger issue here is likely why it takes more than 3.5s for cognito to answer.

See #3920 (comment)

@3-w-c
Copy link

3-w-c commented Jul 18, 2024

Encountered this issue, and adding httpOptions: {timeout: 10000}} resolved it. Thanks!

@devMatheusR
Copy link

Encountered this issue, and adding httpOptions: {timeout: 10000}} resolved it. Thanks!

right, but where i found httpOptions? In my authOptions object?

@3-w-c
Copy link

3-w-c commented Sep 17, 2024

@devMatheusR sorry, I didn't get a notification for this for some reason!

Here's where I added this:

export const authOptions: NextAuthOptions = {
  providers: [
    CognitoProvider({
      clientId: process.env.COGNITO_USER_POOL_CLIENT_ID as string,
      clientSecret: process.env.COGNITO_USER_POOL_CLIENT_SECRET as string,
      issuer: `https://cognito-idp.${process.env.AWS_REGION}.amazonaws.com/${process.env.COGNITO_USER_POOL_ID}`,
      httpOptions: {
        timeout: 10000,
      },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

4 participants