Skip to main content

Hi all,

I'm building a React Native app using Expo (in a development build on Android), and I'm integrating Strava OAuth. I'm using a custom URI scheme for redirection, generated like this:

const redirectUri = AuthSession.makeRedirectUri({ scheme: 'runquest', path: 'strava-redirect', });

This results in a URI like:

runquest://strava-redirect

I'm primarily using the mobile authorization endpoint:

https://www.strava.com/oauth/mobile/authorize

But I’ve also tried the standard web endpoint:

https://www.strava.com/oauth/authorize

In both cases, when the user clicks "Authorize", I receive an "invalid redirect_uri" error from Strava.

What I’ve tried:

  • Setting "runquest" as the Authorized Callback Domain in the Strava Developer Dashboard

  • Setting "localhost" as the Authorized Callback Domain in the Strava Developer Dashboard

  • Trying variations like runquest://, runquest://strava-redirect, and runquest

  • Testing with both OAuth endpoints

My questions:

  1. What should I enter in the Authorized Callback Domain field if I'm using a custom URI scheme like runquest://strava-redirect?

  2. Does Strava support custom URI schemes for mobile redirects, or only HTTPS URLs?

  3. Is this issue expected in Expo development builds, particularly on Android?

Any clarification or examples of working Expo + Strava OAuth setups using custom schemes would be a huge help.

Thanks in advance!

Hello Lars, Im also using Expo and what is working for me is to set Authorized Callback Domain to IP address of the device Im authenticating to Strava. In my case laptop IP because Im using iOS Simulator.
Just an IP. No http or https or anything.

Silvester
 


Hello Lars, Im also using Expo and what is working for me is to set Authorized Callback Domain to IP address of the device Im authenticating to Strava. In my case laptop IP because Im using iOS Simulator.
Just an IP. No http or https or anything.

Silvester
 

You are a lifesaver, this works for me!

For anyone else trying this: this only worked (for me) when running the app through expo go. When using a development build (natively installed on an actual android device), it did not. I don’t know yet how this should work for a production app, but I’ll cross that bridge when I get there. At least I’ll have a testing flow for now, that actually allows me to get data from strava.

 


Reply