Class: OmniAuth::Strategies::Fitbit
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Fitbit
- Defined in:
- lib/omniauth/strategies/fitbit.rb
Instance Method Summary collapse
Instance Method Details
#basic_auth_header ⇒ Object
23 24 25 |
# File 'lib/omniauth/strategies/fitbit.rb', line 23 def basic_auth_header "Basic " + Base64.strict_encode64("#{[:client_id]}:#{[:client_secret]}") end |
#build_access_token ⇒ Object
18 19 20 21 |
# File 'lib/omniauth/strategies/fitbit.rb', line 18 def build_access_token .token_params.merge!(:headers => {'Authorization' => basic_auth_header }) super end |
#query_string ⇒ Object
27 28 29 30 31 |
# File 'lib/omniauth/strategies/fitbit.rb', line 27 def query_string # Using state and code params in the callback_url causes a mismatch with # the value set in the fitbit application configuration, so we're skipping them '' end |
#raw_info ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/omniauth/strategies/fitbit.rb', line 61 def raw_info if [:use_english_measure] == 'true' @raw_info ||= MultiJson.load(access_token.request('get', 'https://api.fitbit.com/1/user/-/profile.json', { 'Accept-Language' => 'en_US' }).body) else @raw_info ||= MultiJson.load(access_token.get('https://api.fitbit.com/1/user/-/profile.json').body) end end |