Hi @vijayazararia , the user cannot get an Access Token with the delete:users
scope during login. Your backend/API can do that though by following the guide here: Get Management API Access Tokens for Production
Our recommendation here is to:
- When the user attempts to delete the profile, send a request to your backend/API with the user’s access token.
- The backend should first validate the access token and get the user_id (sub) from the token.
- The backend generates a new Access Token for the Management API.
- The backend deletes the user and sends a successful response back to the app.
- The app, after getting the response, logs out the user.
I hope that helps.