Issue
i'm using react-native-auth0 to handle my SSO. Login works, but my refresh token is null. Why?
This is the code:
import {useAuth0} from 'react-native-auth0';
export const LoginScreen = () => {
const {authorize, error} = useAuth0();
const onPressLogin = async () => {
const credentials = await authorize();
};
return ....;
};
"react-native-auth0": "^3.0.2",
"react-native": "0.72.6",
In this case, when i call authorize
, open correctly auth0 modal, login succesfully with email and password, and the credentials response is:
{
"idToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCI........Qjf8JLAzF-wc1oqw",
"scope": "openid profile email",
"expiresAt": 1700665033,
"accessToken": "eyJhbGciOiJkaXIiLCJlbm.......RxDDBy54rT9KGlg",
"tokenType": "Bearer",
"refreshToken": null
}
The configuration of auth0 are:
How can I get the refresh token and perform the refresh operation? Thanks
Solution
Add offline_access
to scope in authorize request and enable offline access from the settings.
The refresh_token will only be present in the response if you included the offline_access scope and enabled Allow Offline Access for your API in the Dashboard.
See Add Login Using the Authorization Code Flow with PKCE for details.
Answered By - user18309290
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.