Update idToken add cutom claims from my next app

is it possible to add a cutomClaim to the idToken so i can use it with third-part API from my next app

The scenario is that my logged in used should select and item and on the select event i will call my external API by adding the used choice.

The external API also use my auth0 token to determine the user.

Hi @ghomraniilyas ,

From what I understand, you want to add a custom claim to the access token which is issued to your API to authorize user for the requested resources. To do so, there is a Post Login Flow (Actions feature) with a method: api.accessToken.setCustomClaim(name, value).

Hope this helps, please let us know any questions!

Thank you for your response @marcelina.barycka i want to add the custom claims after the user make a choice in my app (NextJS app the value is the value of the choice)

So i want to change the token from my app goes to Auth0 and returns to my next app with the new token so i can send it to third-part API

Hi @ghomraniilyas ,

The flow is described in this doc - Redirect with Actions (redirect to an external page during the login flow and use the gathered from user data to add custom token claims that will be later returned to your app).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.