Class: OmniAuth::Strategies::MLH

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/mlh.rb

Overview

MLH OAuth2 Strategy

When offline_access scope is requested, the strategy will include refresh_token in the credentials hash if provided by the server.

Examples:

Basic Usage

use OmniAuth::Builder do
  provider :mlh, ENV['MLH_KEY'], ENV['MLH_SECRET']
end

With Expandable Fields

use OmniAuth::Builder do
  provider :mlh, ENV['MLH_KEY'], ENV['MLH_SECRET'],
           expand_fields: ['education', 'professional_experience']
end

With Refresh Tokens (offline access)

use OmniAuth::Builder do
  provider :mlh, ENV['MLH_KEY'], ENV['MLH_SECRET'],
           scope: 'user:read:profile offline_access'
end

Instance Method Summary collapse

Instance Method Details

#dataObject



66
67
68
69
70
# File 'lib/omniauth/strategies/mlh.rb', line 66

def data
  @data ||= fetch_and_process_data.compact
rescue StandardError
  {}
end