Module: Devise

Defined in:
lib/devise_oauth2_authenticatable/model.rb,
lib/devise_oauth2_authenticatable.rb,
lib/devise_oauth2_authenticatable/schema.rb,
lib/devise_oauth2_authenticatable/strategy.rb,
lib/devise_oauth2_authenticatable/view_helpers.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Models, Oauth2Authenticatable

Constant Summary collapse

@@oauth2_uid_field =
:oauth2_uid
@@oauth2_token_field =
:oauth2_token
@@oauth2_auto_create_account =
true

Class Method Summary collapse

Class Method Details

.oauth2_clientObject



32
33
34
# File 'lib/devise_oauth2_authenticatable.rb', line 32

def self.oauth2_client
  @@oauth2_client ||= OAuth2::Client.new(OAUTH2_CONFIG['client_id'], OAUTH2_CONFIG['client_secret'], :site => OAUTH2_CONFIG['authorization_server'])
end

.requested_scopeObject



44
45
46
# File 'lib/devise_oauth2_authenticatable.rb', line 44

def self.requested_scope
  @@requested_scope ||= OAUTH2_CONFIG['requested_scope']
end

.session_sign_in_url(request, mapping) ⇒ Object



37
38
39
40
41
42
# File 'lib/devise_oauth2_authenticatable.rb', line 37

def self.(request, mapping)
  url = URI.parse(request.url)
  url.path = "#{mapping.parsed_path}/#{mapping.path_names[:sign_in]}"
  url.query = nil
  url.to_s
end