api.accessToken.addScope is not a function when used from onExecuteCredentialsExchange action template

Ready to post? :mag: First, try searching for your answer.
As part of rules/hooks migration to actions I have successfully migrated rules to actions but when dealing with hooks, I am facing issues updating scopes from actions when using the onExecuteCredentialsExchange action template due to:

api.accessToken.addScope is not a function

I’ll really appreciate if you could please let me know if there is a way of updating scopes from this m2m action using Credentials Exchange template

1 Like

Hi @jortiz-squaretrade,

Welcome to the Auth0 Community!

The api.accessToken.addScope function only exists for the post-login flow.

In the machine-to-machine flow, that function is unavailable.

Sadly, there is no way to update the scopes in a machine-to-machine action script. I found this feedback request asking for this feature. I recommend upvoting the feedback request so that it can be prioritized for implementation based on the highest votes.

Thanks,
Rueben

Sad news :disappointed:
Any way, thank you very much @rueben.tiow for replying back

1 Like

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