Class: OmniAuth::Strategies::Bungie
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Bungie
- Defined in:
- lib/omniauth/strategies/bungie.rb
Instance Method Summary collapse
Instance Method Details
#build_access_token ⇒ Object
52 53 54 55 56 57 |
# File 'lib/omniauth/strategies/bungie.rb', line 52 def build_access_token verifier = request.params["code"] client.auth_code.get_token(verifier, token_params.to_hash(symbolize_keys: true), deep_symbolize(.auth_token_params)) end |
#client ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/omniauth/strategies/bungie.rb', line 14 def client = ..merge( :connection_opts => { :headers => { 'X-API-Key' => .api_key } }, :redirect_uri => .redirect_uri ) ::OAuth2::Client.new( .client_id, .client_secret, deep_symbolize() ) end |
#raw_info ⇒ Object
45 46 47 48 49 50 |
# File 'lib/omniauth/strategies/bungie.rb', line 45 def raw_info return @raw_info unless @raw_info.nil? @raw_info = access_token.get('/Platform/User/GetMembershipsForCurrentUser/').parsed @raw_info = (@raw_info['ErrorCode'] == 1) ? @raw_info['Response'] : {} end |