The two issues you have
- Only use ENV[] if your data is stored in the shell evironment - the "safer" way to to do this is to store the info in secret.yml
- Your callback URL needs to match what Omniauth is expecting -- it should be http://localhost.mapmyapi.com:12345/auth/mapmyfitness/callback as described here: https://github.com/intridea/omniauth#integrating-omniauth-into-your-application
Example for your omniauth initializer using secrets
Rails.application.config.middleware.use OmniAuth::Builder do
provider :mapmyfitness, Rails.application.secrets.mapmyfitness_provider_key, Rails.application.secrets.mapmyfitness_provider_secret
end
Then your secrets.yml would look like:
development:
mapmyfitness_provider_key: wn3ghaaqgbpnztsupsyfvswd3gtprvm9
mapmyfitness_provider_secret: fRMsDbrNQJBgFUBkYReuqKffFKWTzZWVUKz9jCSTeVJ
Obviously you'll have a different line for production. Remember also that now that your keys are out there for the world you might consider requesting a new set of credentials :)
Also usually important to remember not to your check your config/secrets.yml file into version control - instead copy it with deployment.
Might try using lvh.me instead of mapmyfitness's localhost passthrough.
Change your callback URL registered at mapmyfitness to
http://lvh.me:3000/auth/mapmyfitness/callback
Then in your browser - visit http://lvh.me:3000
Obviously you'll need to make sure that whatever port your using the same port your rails server is running on.