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

pasring error in oauth callback handling #6059

Closed
DeltaByte opened this issue Jun 11, 2020 · 1 comment · Fixed by #6279
Closed

pasring error in oauth callback handling #6059

DeltaByte opened this issue Jun 11, 2020 · 1 comment · Fixed by #6279
Assignees
Labels
OAuth For issues related to OAuth to-be-reproduced Used in order for Amplify to reproduce said issue

Comments

@DeltaByte
Copy link

DeltaByte commented Jun 11, 2020

Describe the bug
Error handling auth response. TypeError: Cannot read property 'substr' of null

To Reproduce

  1. set up Cognito User Pool with facebook as identity provider
  2. call Auth.federatedSignIn({ provider: 'Facebook' })
  3. go through oauth flow until you get redirected back to your application

Expected behavior
SDK makes call out to Cognito to complete the auth flow, using the code query parameter from the callback

Screenshots

What is Configured?

Auth.configure({
  // REQUIRED - Amazon Cognito Region
  region: process.env.AMPLIFY_AUTH_REGION,

  // OPTIONAL - Amazon Cognito User Pool ID
  userPoolId: process.env.AMPLIFY_AUTH_POOL_ID,

  // OPTIONAL - Amazon Cognito Web Client ID (26-char alphanumeric string)
  userPoolWebClientId: process.env.AMPLIFY_AUTH_CLIENT_ID,

  oauth: {
    domain: process.env.AMPLIFY_OAUTH_DOMAIN,
    // scope: ['phone', 'email', 'profile', 'openid', 'aws.cognito.signin.user.admin'],
    redirectSignIn: 'http://localhost:3000/oauth2',
    redirectSignOut: 'http://localhost:3000/oauth2'
    // responseType: 'code' // or 'token', note that REFRESH token will only be generated when the responseType is code
  }
})
Environment
  System:
    OS: Linux 5.6 Arch Linux
    CPU: (8) x64 Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
    Memory: 1.24 GB / 3.84 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 12.18.0 - ~/.nvm/versions/node/v12.18.0/bin/node
    npm: 6.14.4 - ~/.nvm/versions/node/v12.18.0/bin/npm
  npmGlobalPackages:
    @cloudflare/wrangler: 1.9.2
    npm: 6.14.4

Additional context

[ERROR] 42:16.970 OAuth - Error handling auth response. TypeError: Cannot read property 'substr' of null
    at OAuth.eval (OAuth.js?1700:190)
    at step (OAuth.js?1700:55)
    at Object.eval [as next] (OAuth.js?1700:36)
    at eval (OAuth.js?1700:30)
    at new Promise (<anonymous>)
    at __awaiter (OAuth.js?1700:26)
    at OAuth._handleImplicitFlow (OAuth.js?1700:186)
    at OAuth.eval (OAuth.js?1700:246)
    at step (OAuth.js?1700:55)
    at Object.eval [as next] (OAuth.js?1700:36)
    at eval (OAuth.js?1700:30)
    at new Promise (<anonymous>)
    at __awaiter (OAuth.js?1700:26)
    at OAuth.handleAuthResponse (OAuth.js?1700:212)
    at AuthClass.eval (Auth.js?bf82:1748)
    at step (Auth.js?bf82:44)
    at Object.eval [as next] (Auth.js?bf82:25)
    at eval (Auth.js?bf82:19)
    at new Promise (<anonymous>)
    at __awaiter (Auth.js?bf82:15)
    at AuthClass._handleAuthResponse (Auth.js?bf82:1710)
    at eval (Auth.js?bf82:204)
    at eval (urlListener.js?b835:17)
    at AuthClass.configure (Auth.js?bf82:198)
    at eval (amplify-auth.js?ff1d:3)
    at Module../src/plugins/amplify-auth.js (app.js:1228)
    at __webpack_require__ (runtime.js:854)
    at fn (runtime.js:151)
    at eval (index.js:40)
    at Module../.nuxt/index.js (app.js:215)
    at __webpack_require__ (runtime.js:854)
    at fn (runtime.js:151)
    at Module.eval (client.js:41)
    at eval (client.js:1156)
    at Module../.nuxt/client.js (app.js:35)
    at __webpack_require__ (runtime.js:854)
    at fn (runtime.js:151)
    at Object.0 (app.js:1253)
    at __webpack_require__ (runtime.js:854)
    at checkDeferredModules (runtime.js:46)
    at Array.webpackJsonpCallback [as push] (runtime.js:33)
    at app.js:1
@DeltaByte DeltaByte added the to-be-reproduced Used in order for Amplify to reproduce said issue label Jun 11, 2020
@amhinson amhinson added the OAuth For issues related to OAuth label Jun 12, 2020
@ericclemmons ericclemmons self-assigned this Jul 9, 2020
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
OAuth For issues related to OAuth to-be-reproduced Used in order for Amplify to reproduce said issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants