Skip to content

[Auth0] Not receiving a refresh token and error relating to wrong grantType #725

@darthf1

Description

@darthf1

I'm using @nuxtjs/auth-next with the auth0 provider with the PKCE Grant flow. I'm having difficulties with setting up auth0 and getting a refreshToken.

My nuxt.config.ts:

  auth: {
    cookie: {
      options: {
        sameSite: 'strict',
        secure: true,
      },
    },
    localStorage: false,
    plugins: [{ src: '~/plugins/http', ssr: true }],
    redirect: {
      login: '/login/',
      logout: '/',
      callback: '/callback/',
      home: '/',
    },
    strategies: {
      auth0: {
        domain: 'xxx',
        clientId: 'xxx',
        audience: 'xxx',
        scope: ['openid', 'profile', 'email', 'offline_access'],
        responseType: 'token',
        grantType: 'authorization_code',
        codeChallengeMethod: 'S256',
      },
    },
  },

At first, I had the three grants enabled as displayed in the screenshot below.
image

The login was working properly and I was seeing some config related to the PCKE, however I was not receiving any refresh token (just the regulator token).
image

I do have offline access is enabled in the auth0 settings:
image

Then I figured I wouldn't need the implicit grant flow, so I disabled that one. Now I'm getting the following error from auth0:

image

It tells me that the implicit grant is not allowed; which is true because I just disabled it. But I wouldn't expect the grantType implicit to be used, because I set it to authorization_code. Does this mean somethings is wrong with configuring the grantType and could this be the reason I'm not getting a refresh token?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions