LouisaBarrett / runline-2

0 stars 2 forks source link

Strava API "Bad Request" #31

Open breethomas opened 10 years ago

breethomas commented 10 years ago

@jayzes @mikepack

Hi! I am trying to get Strava working, but keep getting error of "Bad Request".

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

I think it might be because I'm not sending my "client id" (570) with the request, but I'm also not entirely sure where/how to handle that (and I might be totally wrong about my hunch).

Here is what I have done:

  1. Add the most current omniauth strava gem I could find to the gemfile.
  2. Updated my .env file to export the Strava Key and Secret. However, I might have wrongly assumed that my "Strava Token" satisfied the "Strava Key" need. In my developer account, I get the following info for my app:

screen shot 2014-02-26 at 4 51 46 pm

My .env file looks like this:


MMF_API_KEY="w8h85v2jnjfdm8uxrtpjs98f6n6nekv7"
MMF_API_SECRET="EcKJtP2HkSRRKq9yk8ZRQkDQ68rpJRFHncE3tJUGwCh"
STRAVA_KEY="44a3fa98ae886c9dfed1d086181f1bcbb9a3b055"
STRAVA_SECRET="1a1c50f29cec379a08ec816151ea835db7c3c3e2"
  1. Added a link in the view to hit the strava auth page. Just using the same convention for other omniauth of link_to "Add Strava", "/auth/strava". I might possibly need to be more explicit here with: https://www.strava.com/oauth/authorize (not sure)

Relevant Strava docs include: http://strava.github.io/api/ http://strava.github.io/api/v3/oauth/

So - hoping if you peruse some of the commits on the strava branch, you might see something, or have some helpful directions to nudge me. Or - if you are up for it, I would totally remote pair this evening. :smile: :heart:

jayzes commented 10 years ago

@breethomas i'll be around later this evening and can pair.

larismendi-tera commented 7 years ago

Hi, Did you found the solution?

mkordik commented 7 years ago

@larismendi-tera, I'm not sure if you found a solution. What worked for me was to change the Authorization Callback Domain under Strava's API settings to match the domain of your server.