4

I am integrating strava api's in my app. I need help regarding the authorization callback domain i.e. required during the api registration so that after the authorization the device browser opens the app again for further usage. When I try to submit the myapp:// as the callback domain it gives me error (This field must be a domain, no slashes or paths). I can't seem to enter anything that is a valid domain. Because the redirect url or uri is something that app describes in its property list. Also it adds the http in the redirect uri by itself. Example when we register myapp as url scheme in strava as well as in plist file then on hitting myapp:// in the safari browser opens the app. But the strava changes this to https://www.strava.com/oauth/authorize?client_id=*****&response_type=code&redirect_uri=http://myapp&approval_prompt=force.

Why there is http:// added in the redirect uri and also why I am not able to register myapp:// as the redirect uri ?

I have checked one older example having slashes in their redirect uri. So how that example is working and registered with slashes in redirect uri?

So, Anybody please help me in solving this issue.

Thanks In Advance.

Anshul Bhatheja
  • 673
  • 3
  • 21

1 Answers1

16

I have contacted Strava Developer Support for the above said issue and got their reply that we can register myapp.com as authorisation callback domain in strava, myapp as url scheme in info.plist and myapp://myapp.com as the redirect uri for strava api.

After implementing this, my app works well and performs the oauth flow as is supposed to do.

I am posting this answer here so as to help anybody else facing the same issue.

Thanks

Anshul Bhatheja
  • 673
  • 3
  • 21
  • 1
    Thanks @Mariam, But I have already solved this problem with the given solution. – Anshul Bhatheja Feb 04 '19 at 04:25
  • You know ur answer should be in Strava Wiki :D. I wasted 1 day figuring this out. Thanks – Bhaskar Dabhi Jun 25 '19 at 11:30
  • Happy to hear that my answer had helped you in solving your problem. – Anshul Bhatheja Jun 26 '19 at 05:04
  • @AnshulBhatheja did you face any issue while fetching token after authentication? I keep getting 400 even though correct client_id is passed. https://stackoverflow.com/q/56774113/1398979 – Bhaskar Dabhi Jun 27 '19 at 09:51
  • @BhaskarDabhi, I have added a comment on your question. Please check their. – Anshul Bhatheja Jun 27 '19 at 09:58
  • Happy to hear that @Navigator, please upvote the answer so that it will also help others. – Anshul Bhatheja Oct 02 '20 at 07:01
  • If somebody use expo as build platform for mobile app,Authorization Callback Domain in Strava profile shuld be exp.host. – sloser Feb 04 '21 at 08:55
  • This worked for me. It's very delicate, I have a feeling given "myapp://myapp.com", it's a requirement of the strava tooling that the first "myapp" is exactly equal to the second "myapp", (even though generally, that's not technically a requirement) but I'm not positive about that. Ok tested, this doesn't look like a strong requirement – nteissler Dec 31 '21 at 13:01