Class: OmniauthOidc::ResponseObjects::IdToken
- Inherits:
-
Object
- Object
- OmniauthOidc::ResponseObjects::IdToken
show all
- Defined in:
- lib/omniauth/oidc/response_objects.rb
Overview
Represents an OIDC ID Token with claims
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(attributes = {}) ⇒ IdToken
Returns a new instance of IdToken.
10
11
12
|
# File 'lib/omniauth/oidc/response_objects.rb', line 10
def initialize(attributes = {})
@raw_attributes = attributes.is_a?(Hash) ? attributes : attributes.to_h
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
Allow method-style access to claims
39
40
41
42
43
|
# File 'lib/omniauth/oidc/response_objects.rb', line 39
def method_missing(method_name, *args)
return raw_attributes[method_name.to_s] if raw_attributes.key?(method_name.to_s)
super
end
|
Instance Attribute Details
#raw_attributes ⇒ Object
Returns the value of attribute raw_attributes.
8
9
10
|
# File 'lib/omniauth/oidc/response_objects.rb', line 8
def raw_attributes
@raw_attributes
end
|
Instance Method Details
#aud ⇒ Object
22
23
24
|
# File 'lib/omniauth/oidc/response_objects.rb', line 22
def aud
raw_attributes["aud"]
end
|
#exp ⇒ Object
26
27
28
|
# File 'lib/omniauth/oidc/response_objects.rb', line 26
def exp
raw_attributes["exp"]
end
|
#iat ⇒ Object
30
31
32
|
# File 'lib/omniauth/oidc/response_objects.rb', line 30
def iat
raw_attributes["iat"]
end
|
#iss ⇒ Object
18
19
20
|
# File 'lib/omniauth/oidc/response_objects.rb', line 18
def iss
raw_attributes["iss"]
end
|
#nonce ⇒ Object
34
35
36
|
# File 'lib/omniauth/oidc/response_objects.rb', line 34
def nonce
raw_attributes["nonce"]
end
|
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
45
46
47
|
# File 'lib/omniauth/oidc/response_objects.rb', line 45
def respond_to_missing?(method_name, include_private = false)
raw_attributes.key?(method_name.to_s) || super
end
|
#sub ⇒ Object
14
15
16
|
# File 'lib/omniauth/oidc/response_objects.rb', line 14
def sub
raw_attributes["sub"]
end
|