No commit activity in last 3 years
No release in over 3 years
OmniAuth strategy for authenticating against MapMyFitness with OAuth 2
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

OmniAuth MapMyFitness OAuth2

This gem contains the MapMyFitness strategy for OmniAuth using OAuth2.

Setup

Install the Gem

Add the dependency to your application's Gemfile:

gem 'omniauth-mapmyfitness-oauth2'

Key & Secret Variables

Your secret credentials should be stored in environment variables. You can do this in a your .bash_profile with the following:

export MMF_API_KEY=your_key_goes_here
export MMF_API_SECRET=your_secret_goes_here

Checking Environment Variables

Once you have those ENV variables set, you can check them from IRB:

$ irb
> ENV['MMF_API_KEY']
 => "09375ijkds9072l"
> ENV['MMF_API_SECRET']
 => "08993mhjd8721lk"

Create an Initializer

Create a config/initializers/omniauth.rb with the following:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :mapmyfitness, ENV['MMF_API_KEY'], ENV['MMF_API_SECRET']
end

NOTE: The ENV['MMF_API_KEY'] is unsed in an unusual place in this strategy. It must be defined for the library to work.