Class: OmniauthOidc::ResponseObjects::AccessToken
- Inherits:
-
Object
- Object
- OmniauthOidc::ResponseObjects::AccessToken
- Defined in:
- lib/omniauth/oidc/response_objects.rb
Overview
Represents an OAuth2 Access Token
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#expires_in ⇒ Object
readonly
Returns the value of attribute expires_in.
-
#id_token ⇒ Object
readonly
Returns the value of attribute id_token.
-
#refresh_token ⇒ Object
readonly
Returns the value of attribute refresh_token.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#token_type ⇒ Object
readonly
Returns the value of attribute token_type.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ AccessToken
constructor
A new instance of AccessToken.
- #to_h ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ AccessToken
Returns a new instance of AccessToken.
155 156 157 158 159 160 161 162 |
# File 'lib/omniauth/oidc/response_objects.rb', line 155 def initialize(attributes = {}) @access_token = attributes["access_token"] || attributes[:access_token] @token_type = attributes["token_type"] || attributes[:token_type] @expires_in = attributes["expires_in"] || attributes[:expires_in] @refresh_token = attributes["refresh_token"] || attributes[:refresh_token] @scope = attributes["scope"] || attributes[:scope] @id_token = attributes["id_token"] || attributes[:id_token] end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
153 154 155 |
# File 'lib/omniauth/oidc/response_objects.rb', line 153 def access_token @access_token end |
#expires_in ⇒ Object (readonly)
Returns the value of attribute expires_in.
153 154 155 |
# File 'lib/omniauth/oidc/response_objects.rb', line 153 def expires_in @expires_in end |
#id_token ⇒ Object (readonly)
Returns the value of attribute id_token.
153 154 155 |
# File 'lib/omniauth/oidc/response_objects.rb', line 153 def id_token @id_token end |
#refresh_token ⇒ Object (readonly)
Returns the value of attribute refresh_token.
153 154 155 |
# File 'lib/omniauth/oidc/response_objects.rb', line 153 def refresh_token @refresh_token end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
153 154 155 |
# File 'lib/omniauth/oidc/response_objects.rb', line 153 def scope @scope end |
#token_type ⇒ Object (readonly)
Returns the value of attribute token_type.
153 154 155 |
# File 'lib/omniauth/oidc/response_objects.rb', line 153 def token_type @token_type end |
Instance Method Details
#to_h ⇒ Object
164 165 166 167 168 169 170 171 172 173 |
# File 'lib/omniauth/oidc/response_objects.rb', line 164 def to_h { "access_token" => access_token, "token_type" => token_type, "expires_in" => expires_in, "refresh_token" => refresh_token, "scope" => scope, "id_token" => id_token }.compact end |