#Junket - Connect
1 messages · Page 1 of 1 (latest)
Hello! Where exactly are you seeing that error? Is it on your own site or inside the hosted onboarding page?
It is on my own site after being redirect there from the hosted page
Can you share the code you're using to complete the OAuth connection?
Sure one sec
Thank you!
We're simply building the auth URL our user follows from the elements (scope, state, redirect_uri, etc passed to the authorize_url method of ruby's OAuth2::Client object) Here's an example auth URL, which produces the hosted page as expected: https://connect.stripe.com/oauth/v2/authorize?access_type=offline&client_id=ca_HI6OulAdszgXklWmJtXeoRjETVA5MiAR&redirect_uri=https%3A%2F%2Fapp.messagemgr.com%2Fauth%2Fstripe%2F49ae34d4-551e-4dcb-8576-7130b436ba52%2Fcallback&response_type=code&scope=read_write&state=IjRso50oKG5kzw4q
No, I mean the code that runs on your page to finish the connection after they're redirected back from the onboarding flow.
The code where you specify the grant_type and code and send those to the Stripe API.
ah okay sorry one sec
It sounds like you might have some code somewhere that's attempting to validate the stripe_user_id you get back from Stripe after the OAuth connection is complete and either that validation code is incorrect or you're not getting the expected result from the OAuth connection.
that's the thing--I'm 99% sure we're not validating the existence of the stripe_user_id--our code just encrypts and saves the token and then all other attributes in a JSON store if we need them later
the error verbiage is coming from Stripe, I believe
"invalid request: stripe_user_id failed validation: Required field"
I see that we're maybe attempt to capture a refresh token on auth--maybe that requires the stripe_user_id? trying to test...
I don't believe that message is from Stripe, but let me confirm...
cool, thank you so much
Oh, that is coming from us... but that doesn't make sense in the context of establishing a new OAuth connection. Can you share the code? I think if I saw what you're doing I would be able to point out the issue.
The stripe_user_id property is only sent to Stripe when deauthorizing a connection.
You said you're using Ruby... are you calling Stripe::OAuth.deauthorize anywhere?
You sir, are correct: we inadvertently swapped the token URL with the deauth URL FACEPALM. Thank you! Sorry to waster your time. I've still got issue but no doubt on my side. Thanks again!
Thank you! Really appreciate it. It's great that you do this