Skip to main content

 I can’t do the very first thing with the integration!   I am unable to get an access code after I get the authorization code.

Get authorization code via browser

http://www.strava.com/oauth/authorize?client_id=eCLIENT_ID]&response_type=code&redirect_uri=http://localhost/strava-app/callback.php&approval_prompt=force&scope=read

which returns a legit authorization code

http://localhost/strava-app/callback.php?state=&code=b2ab5e0a49ff7f7595d98fae7970e98b428bc600&scope=read

Then, when I feed this into postman along with my secret code and client_id I get an Authorization Error and it doesn’t return the access code.

What could I be doing wrong?

Ciao ​@Mike220. I've just found this thread. I don't know if it's exactly your issue but check it. Hope it helps.

https://communityhub.strava.com/developers-api-7/401-error-1652?tid=1652&fid=7


Double check both your client_id and client_secret. The error you are getting is “Application Invalid.” This means either your client_id or client_secret are incorrect. One common issue I’ve seen is including an extra space before/after when you copy/paste from the API page.

If instead you provide the wrong/expired code, you will see this error, which tells you the code is invalid

{
"message": "Bad Request",
"errors": o
{
"resource": "AuthorizationCode",
"field": "code",
"code": "invalid"
}
]
}

 


Turns out I get this error when running the code on localhost even though my callback page and the domain setting in my account are using the same domain (i.e. localhost).  The only way I could get it to  work is to run it on the real site.

 


Reply