Auth0, Stripe, app data in All Client Side Flow

Hello

I am using Auth0 to handle authentication.

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?

Any ideas at all would be appreciated.

Tom

Hi @tomgallagher,

Welcome to the Community!

You could try setting this up with the management API:

Depending on the limitations of the stripe webhook, you may be able to set this up as a typical M2M communication.

Hope this helps,
Dan

Hi Dan

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?

Tom

@tomgallagher,

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.

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