Dheeraj kumar Rao
Dheeraj kumar Rao

Reputation: 10262

auth0.js unable to get refresh token

I am using auth0-js

const auth = new auth0.WebAuth({
  domain: origin,
  clientID: cId,
  redirectUri: `${window.location.origin}/cb`,
  responseType: 'code',
  scope: 'openid email profile offline_access',
});
auth.authorize();

In the callback, I am the only getting access_token, idToken. But according to documentation for a refresh token, only add offline_access to scope. it will return a refresh token.

Upvotes: 1

Views: 430

Answers (2)

Vadym Berkut
Vadym Berkut

Reputation: 303

You can find the source answer in the Auth0 Community. Answer:

  1. SPA: set config useRefreshTokens to true
  2. API Config: set Allow Offline Access to true
  3. Application config: Advanced Settings \ Grant Types \ Refresh Token enable
  4. Application config: enable Refresh Token Rotation

Upvotes: 0

Dheeraj kumar Rao
Dheeraj kumar Rao

Reputation: 10262

I got the answer, I have to pass the prompt in auth.authorize({prompt: 'consent'})

Upvotes: 0

Related Questions