Class: Code0::Identities::Provider::BaseOauth
- Inherits:
-
Object
- Object
- Code0::Identities::Provider::BaseOauth
show all
- Defined in:
- lib/code0/identities/provider/base_oauth.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(config_loader) ⇒ BaseOauth
Returns a new instance of BaseOauth.
9
10
11
|
# File 'lib/code0/identities/provider/base_oauth.rb', line 9
def initialize(config_loader)
@config_loader = config_loader
end
|
Instance Attribute Details
#config_loader ⇒ Object
Returns the value of attribute config_loader.
7
8
9
|
# File 'lib/code0/identities/provider/base_oauth.rb', line 7
def config_loader
@config_loader
end
|
Instance Method Details
#authorization_url ⇒ Object
13
14
15
|
# File 'lib/code0/identities/provider/base_oauth.rb', line 13
def authorization_url
raise NotImplementedError
end
|
#load_identity(**params) ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/code0/identities/provider/base_oauth.rb', line 29
def load_identity(**params)
code = params[:code]
token, token_type = access_token code
response = HTTParty.get(user_details_url,
headers: {
Authorization: "#{token_type} #{token}",
"Accept" => "application/json"
})
check_response response
create_identity response, token, token_type
end
|
#token_payload(code) ⇒ Object
25
26
27
|
# File 'lib/code0/identities/provider/base_oauth.rb', line 25
def token_payload(code)
raise NotImplementedError
end
|
#token_url ⇒ Object
17
18
19
|
# File 'lib/code0/identities/provider/base_oauth.rb', line 17
def token_url
raise NotImplementedError
end
|
#user_details_url ⇒ Object
21
22
23
|
# File 'lib/code0/identities/provider/base_oauth.rb', line 21
def user_details_url
raise NotImplementedError
end
|