I am using React.js and the @auth0/auth0-react SDK. I have a custom backend API. So my Auth0Provider component is configured with the audience of that custom API.
However i also want the user to able to update user’s own user_metadata using the Management API. I have created a page component to get input from user and update the user_metadata with that input. So I need to get an accessToken for the Management API, and this is where the issue occurs. If I try to use ‘getAccessTokenSilently’ it redirect me to a page because I have already signed in for the custom API and so all the progress is lost, another way is to use getAccessTokenWithPopup. This way react.js prompts a popup page, and gets the accessToken without any need of additional login. But this triggers another issue. Popups are not that eye-pleasing and often gets blocked by the browser. So i have to use silent method somehow.
Hope you can help me. Thanks in advance.