Class: Jm81auth::OAuth::Google

Inherits:
Base
  • Object
show all
Defined in:
lib/jm81auth/oauth/google.rb

Constant Summary collapse

ACCESS_TOKEN_URL =
'https://oauth2.googleapis.com/token'
DATA_URL =
'https://www.googleapis.com/oauth2/v3/userinfo'

Instance Method Summary collapse

Methods inherited from Base

#data, #display_name, #email, #get_data, #initialize, #provider_data, #provider_id, #provider_name

Constructor Details

This class inherits a constructor from Jm81auth::OAuth::Base

Instance Method Details

#get_access_tokenObject



7
8
9
10
11
12
13
# File 'lib/jm81auth/oauth/google.rb', line 7

def get_access_token
  response = client.post(
    ACCESS_TOKEN_URL, @params.merge(grant_type: 'authorization_code')
  )

  JSON.parse(response.body)['access_token']
end