#menguanito-oauth-connect
1 messages · Page 1 of 1 (latest)
hello, not sure I understand the part
how can I redirect the OAuth response (the redirect_uri parameter) to my local dev server to test my endpoint?
can you explain more what you mean exactly?
(I know the OAuth flow, just want the question rephrased, which part you're blocked on)
That's simple: when I build the OAuth url so my customer can connect his Stripe account to mine, I can add a redirect_uri parameter with the URL where the user will be redirected to after connecting their account:
https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_XXXXXXXXXXXXXXXX&scope=read_write&redirect_uri=mysite.com/stripeConnect
This will work as spected. But if I want to redirect to my local web server, let's say "application.ocal/stripeConnect", this won't work, isn't it?
Or I'm wrong, and the parameter redirect_uri isn't a full url to my server?
Please, correct me if I'm wrong. As far as I understand, the OAuth flow is:
- I generate an URL to Stripe Connect. My customer visit the url, and fill all the data
- After the customer fills all the data and send it to Stripe, he is redirected (GET request) to
redirect_uri(or the url defined in the Stripe Dashboard). In this call, my application receives the authorization code - I made a POST request using the authorization code, to get customer's token
reading one sec
yep your steps 1-3 are right
so to your earlier question:
But if I want to redirect to my local web server, let's say "application.ocal/stripeConnect", this won't work, isn't it?
this would work, so something like "localhost:3000/stripeConnectRedirect" could be your redirectURI in test mode. I think that works but I'm not fully sure since I've mostly tested via ngrok where I always have a public tunnel to my local webserver, so I can set https://mydomain.ngrok.io/connect which is a public url to my local webserver due to ngrok