Class: Sitefull::Auth::Google

Inherits:
Base
  • Object
show all
Defined in:
lib/sitefull-cloud/auth/google.rb

Constant Summary collapse

AUTHORIZATION_URI =
'https://accounts.google.com/o/oauth2/auth'.freeze
CALLBACK_URI =
'/oauth/google/callback'.freeze
SCOPE =
%w(https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/compute).freeze
TOKEN_CREDENTIALS_URI =
'https://www.googleapis.com/oauth2/v3/token'.freeze

Constants inherited from Base

Base::MISSING_AUTHORIZATION_URI, Base::MISSING_BASE_URI, Base::MISSING_BASE_URI_SCHEME, Base::MISSING_CALLBACK_URI, Base::MISSING_CLIENT_ID, Base::MISSING_CLIENT_SECRET, Base::MISSING_REDIRECT_URI_SCHEME, Base::MISSING_SCOPE, Base::MISSING_TOKEN_CREDENTIALS_URI

Instance Method Summary collapse

Methods inherited from Base

#initialize, #required_settings, #token_options, #validate

Constructor Details

This class inherits a constructor from Sitefull::Auth::Base

Instance Method Details

#authorization_uri(_) ⇒ Object



24
25
26
# File 'lib/sitefull-cloud/auth/google.rb', line 24

def authorization_uri(_)
  AUTHORIZATION_URI
end

#authorization_url_optionsObject



12
13
14
# File 'lib/sitefull-cloud/auth/google.rb', line 12

def authorization_url_options
  super.merge({ access_type: 'offline', approval_prompt: 'force', include_granted_scopes: true })
end

#callback_uriObject



20
21
22
# File 'lib/sitefull-cloud/auth/google.rb', line 20

def callback_uri
  CALLBACK_URI
end

#credentials(token) ⇒ Object



16
17
18
# File 'lib/sitefull-cloud/auth/google.rb', line 16

def credentials(token)
  token
end

#scopeObject



28
29
30
# File 'lib/sitefull-cloud/auth/google.rb', line 28

def scope
  SCOPE
end

#token_credentials_uri(_) ⇒ Object



32
33
34
# File 'lib/sitefull-cloud/auth/google.rb', line 32

def token_credentials_uri(_)
  TOKEN_CREDENTIALS_URI
end