#justinw
1 messages ยท Page 1 of 1 (latest)
No, I don't think there's a way to see those requests in the dashboard at all
got it
are you able to see it on your end somehow?
this is a pretty old integration that's been having these issues all of a sudden lately, and haven't found the source
should I DM main account id?
You can share the main account ID here!
๐ I'll take a look
thank you!!
Do you happen to have a timerange when you know this bad request happened?
what time zone?
One strange detail on the auth flow is that I'm seeing that error, but my user table is populating back with an access_token -- however, on my app on the checkout flow we're seeing
so trying to get more error fidelity to dial in a bit
Do you happen to have the account ID for that connected account? I'm having more trouble than I thought I would narrowing this down
cool
So it looks like you're accidentally the same access token twice - which automatically disconnects that connected account from the platform (and that's why you're seeing those "Expired API key provided" errors)
accidentally creating?
oops accidentally using the same authorization token twice in two different https://connect.stripe.com/oauth/token requests
(Sorry i've been typing too fast and had to edit it)
hmm isn't the authorization / bearer token for that request
my constant app api key?
(been a while since I wrote this so catching back up to speed)
No, that's not what you should be passing in:
https://stripe.com/docs/connect/oauth-reference#post-token-request
The authroziation header includes your (the platform's) API key
I'm talking about the authorization code you'd pass in with the request body
Yeah - the first request to https://connect.stripe.com/oauth/token succeeds, but the second one you make right after that is failing with a 400 (because you're reeusing the authorization code)
ahhhh
ok thank you -- i'm going to debug a bit more on my end. Is it possible to keep this thread open ?
๐ I'll keep the thread open a bit longer, but we do close this channel right at 5 PM (pacific time) so I'll have to close the thread at that point
ok got it
one thing im seeing in the logs
is/stripe_authorization?error=access_denied&error_description=The+user+denied+your+request
(/stripe_authorization is my redirect_uri)
Yeah I think that's something separate - you'd get that if the to-be-connected account chose to reject the connection
got it
potentially too specific to my application -- but the request to /oauth/token is taking place on the handler to the redirect_uri I passed into https://connect.stripe.com/oauth/authorize
code = params[:code]
if !code
redirect_to raffles_path
return
end
begin
body = { :code => code, :grant_type => "authorization_code" }.to_json
logger.info "1. TRYING CONNECTING TO STRIPE WITH CURRENT USER: #{current_user.email}"
response = RestClient.post "https://connect.stripe.com/oauth/token", body,
{
:content_type => "application/json",
:authorization => "Bearer #{ENV["STRIPE_APP_KEY"]}"
}```
trying to understand how that might be getting called two times in a row
either Stripe is accidentally redirecting twice
or only other thing I could thing of is maybe I set it to an HTTP base url and the browser is redirected to an HTTPS
ah I am setting https on that URL
It really could be anything - I doubt it would be stripe redirecting twice. It could be something as simple as a browser refresh that does it
yeah maybe I should just add
a check to see if the user is already authed
just to double check my unerstanding
logs are showing that we ARE triggering a successful request and getting the access_token back etc
but then we're another request, which throws the 400, and invalidates that access_token we have saved
yup that's what I'm seeing in the logs!
ok sweet, im gonna add in that check
and hopefully that just catches the double call even if I can't find the root cause of it
๐
massive thanks for the aid here
been causing me some serious pain for the last couple weeks
happy to help! this used to come up a lot more when the oauth flow was more common ๐
We talk about it here (https://stripe.com/docs/connect/standard-accounts) - now we recommend Account Links
sweet swill check it out
But it won't work if you're trying to conenct to existing accounts
yeah, that's why we still have a good chunk of people still on oauth
alright thanks again! gonna push this up and head out