Assistance Needed: Modifying Access Token Scope in Machine to Machine Application

How can I update the access token in a Machine to Machine application using Actions? I’ve referred to the official documentation, but I couldn’t find a method to update the “scope” claim. While I can set custom claims, modifying the “scope” claim seems elusive. Can you provide guidance on this?

Official Doc :

Here’s the snippet I’ve been using to add a new claim:

exports.onExecuteCredentialsExchange = async (event, api) => {
// Set the custom claim for the access token
api.accessToken.setCustomClaim(‘http://scope’, ‘free’);
};

I’d appreciate any assistance you can offer.

Hi @Sakshi05

Welcome to the Auth0 Community!

Thank you for posting your question. As for now with the usage of Actions you are only able to add or remove scope from access token

Access Token Scope

  • api.accessToken.addScope(scope)
  • api.accessToken.removeScope(scope)

If you find this feature missing or necessary please open a topic in the Feedback category so other community members can vote on it. Our Product team is constantly checking for a new feature opportunities.

Thanks
Dawid

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