Class: OAuth2c::TwoLegged::Base
- Inherits:
-
Object
- Object
- OAuth2c::TwoLegged::Base
- Defined in:
- lib/oauth2c/two_legged.rb
Direct Known Subclasses
Grants::Assertion, Grants::ClientCredentials, Grants::RefreshToken, Grants::ResourceOwnerCredentials
Instance Attribute Summary collapse
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(agent, scope: []) ⇒ Base
constructor
A new instance of Base.
- #token ⇒ Object
- #update_scope(scope) ⇒ Object
Constructor Details
#initialize(agent, scope: []) ⇒ Base
Returns a new instance of Base.
22 23 24 25 |
# File 'lib/oauth2c/two_legged.rb', line 22 def initialize(agent, scope: []) @agent = agent update_scope(scope) end |
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
20 21 22 |
# File 'lib/oauth2c/two_legged.rb', line 20 def scope @scope end |
Instance Method Details
#token ⇒ Object
31 32 33 34 |
# File 'lib/oauth2c/two_legged.rb', line 31 def token ok, response = @agent.token({ **token_params, scope: @scope }) handle_token_response(ok, response) end |
#update_scope(scope) ⇒ Object
27 28 29 |
# File 'lib/oauth2c/two_legged.rb', line 27 def update_scope(scope) @scope = scope.dup.freeze end |