SweetzpotAS / StravaZpot-Android

A fluent API to integrate with Strava on Android apps
70 stars 36 forks source link

Error with OAuth #18

Closed ToysoftInc closed 6 years ago

ToysoftInc commented 6 years ago

Not sure why it's difficult to do but I followed the instructions and getting error.

Intent intent = StravaLogin.withContext(this) .withClientID(STRAVA_CLIENT_ID) .withRedirectURI("localhost") .withApprovalPrompt(ApprovalPrompt.AUTO) .withAccessScope(AccessScope.VIEW_PRIVATE_WRITE) .makeIntent(); startActivityForResult(intent, REQUEST_STRAVA_LOGIN);

Got this error:

{"message": "Bad request","errors":[{resource":"Application","field":"redirect_uri", "code":"invalid"}]}

Edit: fixed my problem. It was the uri

truizlop commented 6 years ago

I guess you already figured it out, but the redirect URI needs to match the one you told Strava when you registered your application, as stated in the error message and the README.