How to connect to management api in React native

I am using a auth0 react native package in an expo app and am wondering what the best way to connect to the management API in order to read a users app_metadata is? Any advice helps there does not seem to be much documentation on this.

Hi @micahcb,

The auth0-react package contains a ManagementClient class for calling the Management API’s endpoints.

If you have any other questions, feel free to reach out.

Have a good one,
Vlad

Hi Vlad Looks like I am getting this error
{“error”:“unauthorized_client”,“error_description”:“Grant type ‘client_credentials’ not allowed for the client.”,“error_uri”:“https://auth0.com/docs/clients/client-grant-types”}

Is it not allowed for react native apps? If so how could I retrieve and update users app_metadata

Hi again,

This community post should be of help:

If you have any difficulties, feel free to reach out.

Have a good one,
Vlad

Go to your Auth0 Dashboard, into your app settings, and scroll down until you find Advanced Settings and select the Client Credentials grant type.


Mine looks like this, which seems to be an issue with it being a native app

Hi again @micahcb,

SPA and native applications must be set to confidential before setting the Client Credential grant.

Use the Update a client endpoint of the Auth0 Management API to set the token_endpoint_auth_method to client_secret_post, client_secret_basic, or private_key_jwt.

If you have any other questions, feel free to reach out.

Have a good one,
Vlad

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