Class: Doorkeeper::OAuth::Authorization::Token
- Inherits:
-
Object
- Object
- Doorkeeper::OAuth::Authorization::Token
- Defined in:
- lib/doorkeeper/oauth/authorization/token.rb
Instance Attribute Summary collapse
-
#pre_auth ⇒ Object
Returns the value of attribute pre_auth.
-
#resource_owner ⇒ Object
Returns the value of attribute resource_owner.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #configuration ⇒ Object
-
#initialize(pre_auth, resource_owner) ⇒ Token
constructor
A new instance of Token.
- #issue_token ⇒ Object
Constructor Details
#initialize(pre_auth, resource_owner) ⇒ Token
Returns a new instance of Token.
7 8 9 10 |
# File 'lib/doorkeeper/oauth/authorization/token.rb', line 7 def initialize(pre_auth, resource_owner) @pre_auth = pre_auth @resource_owner = resource_owner end |
Instance Attribute Details
#pre_auth ⇒ Object
Returns the value of attribute pre_auth.
5 6 7 |
# File 'lib/doorkeeper/oauth/authorization/token.rb', line 5 def pre_auth @pre_auth end |
#resource_owner ⇒ Object
Returns the value of attribute resource_owner.
5 6 7 |
# File 'lib/doorkeeper/oauth/authorization/token.rb', line 5 def resource_owner @resource_owner end |
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/doorkeeper/oauth/authorization/token.rb', line 5 def token @token end |
Instance Method Details
#configuration ⇒ Object
22 23 24 |
# File 'lib/doorkeeper/oauth/authorization/token.rb', line 22 def configuration Doorkeeper.configuration end |
#issue_token ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/doorkeeper/oauth/authorization/token.rb', line 12 def issue_token @token ||= AccessToken.create!({ :application_id => pre_auth.client.id, :resource_owner_id => resource_owner.id, :scopes => pre_auth.scopes.to_s, :ttl => configuration.access_token_expires_in, :use_refresh_token => false }) end |