0

I am having a problem with the @nuxtjs/auth-next module for connecting via Cognito. It does send me to my cognito login portal and redirects me with to my app with my token value, and type.

However the module doesn't consume it, it doesnt say that I am logged in and doesn't fetch the user info.

Here is my nuxt.config.js:

strategies: {
  awsCognito: {
    scheme: 'oauth2',
    endpoints: {
      authorization: 'https://***********************/login',
      token: 'https://***********************/oauth2/token',
      userInfo: 'https://***********************/oauth2/userInfo',
      logout: 'https://***********************/logout'
    },
    token: {
      property: 'access_token',
      type: 'Bearer',
      required: true,
      maxAge: 3600
    },
    refreshToken: {
      property: 'refresh_token',
      maxAge: 60 * 60 * 24 * 30
    },
    user: {
      property: true,
      autoFetch: true,
      propertyName: false
    },
    responseType: 'token',
    redirectUri: 'http://localhost:3000/callback',
    logoutRedirectUri: 'http://localhost:3000/',
    clientId: '******************',
    scope: ['email', 'openid'],
    codeChallengeMethod: 'S256'
  }
}
kissu
  • 40,416
  • 14
  • 65
  • 133
Jimichou
  • 1
  • 1
  • Does this config match what you do see in the network tab response? – kissu Dec 21 '21 at 17:03
  • I am getting this in the params which looks ok ? /login?response_type=token&client_id=34jk2rvmg29fkm7nvh6522m63n&redirect_uri=http://localhost:3000/callback&scope=email openid&state=0SJ9ur68l0&code_challenge_method=S256&nonce=jSJZyo1hNp&code_challenge=OpeHXMlfmdjHW3eXzFWE_VNm6qF_4i3DC6DXixWPy8Y – Jimichou Dec 21 '21 at 17:15
  • Not sure of the actual thing. Please edit your question rather than posting it inline here, it's not really readable. – kissu Dec 21 '21 at 17:17

0 Answers0