Hello guys,
I have a custom action that I added to the “Login” flow to add custom claims, in this case the email of the user:
exports.onExecutePostLogin = async (event, api) => {
if (event.authorization) {
api.accessToken.setCustomClaim(“email”, event.user.email);
}
};
On my Android app, I’m using the refresh token to get a new access token, it works however the new access token doesn’t have the custom claim, how can I allow new access tokens have the same claims (using the refresh token)?
Here’s my Android code that does the refresh (for reference):
val client = AuthenticationAPIClient(auth0)
var newAccessToken = “”
try {
client.renewAuth(refreshToken)
.start(object: Callback<Credentials, AuthenticationException> {
override fun onFailure(error: AuthenticationException) {
Log.e(“AUTH0 Error”, “onFailure: $error”)
}
override fun onSuccess(result: Credentials) {
newAccessToken = result.accessToken
Log.e("AUTH0 Success", "onSuccess: $result")
}
})