Once the user is authenticated, I need to handle payments with Stripe.
This is all client-side, which adds some complications. I would like Auth0 to be the single source of truth for a user.
In short, I need to be able to update the Auth0 app_metadata with the subscription data from the Stripe payments. I have a webhook in Stripe that I can use for a successful payment. It can call a URL endpoint, for example. Is it then possible for Stripe to communicate with Auth0 to update the user’s subscription status?
Thanks for getting back. I have investigated the Management API and could do that from the client side. I’m not sure that I can set it up on Stripe though. What is a typical M2M communication?
You should be cautious calling the management API from the client side, as it is quite limited due to the open nature of client side code. Check out this doc to see how to set things up.
M2M is essentially just server to server communication. You request a token with a client id and secret, then use the token in requests. You may need to setup some proxy between the stripe web hook and the management API.