iamstuartwilson / strava

PHP Class for the Strava API (v3)
MIT License
120 stars 26 forks source link

Unable to Complete Token Exchange? #4

Closed theblanchard closed 9 years ago

theblanchard commented 9 years ago

I have been able to successfully authenticate with my app credentials, but when I try to complete the token exchange, I get a "page not found" error and {"message":"Authorization Error","errors":[{"resource":"Athlete","field":"access_token","code":"invalid"}]}

A gist with my code is available here: https://gist.github.com/theblanchard/0c2da687e8c3c2d3a89a

I am relatively new to PHP, so any help you can provide is greatly appreciated!

Page after successful auth with API errors: dev_error

Page with successful auth using hardcoded access_code in URL: dev

iamstuartwilson commented 9 years ago

Hi @theblanchard, sorry its taken so long to get back to you on this. Could you provide some code examples to support your problem?

[EDIT:] Just seen the gist!

Cheers,

Stuart

iamstuartwilson commented 9 years ago

@theblanchard on line 53:

$url = $api->authenticationUrl($redirect, $approvalPrompt = 'auto', $scope = null, $state = null);

You've left the default values in here. Try this instead:

$url = $api->authenticationUrl($redirect);
theblanchard commented 9 years ago

Thanks! I actually figured this out, forgot to close the issue.