Class: Doorkeeper::OAuth::Authorization::Code
- Inherits:
-
Object
- Object
- Doorkeeper::OAuth::Authorization::Code
- Defined in:
- lib/doorkeeper/oauth/authorization/code.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) ⇒ Code
constructor
A new instance of Code.
- #issue_token ⇒ Object
Constructor Details
#initialize(pre_auth, resource_owner) ⇒ Code
Returns a new instance of Code.
7 8 9 10 |
# File 'lib/doorkeeper/oauth/authorization/code.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/code.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/code.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/code.rb', line 5 def token @token end |
Instance Method Details
#configuration ⇒ Object
26 27 28 |
# File 'lib/doorkeeper/oauth/authorization/code.rb', line 26 def configuration Doorkeeper.configuration end |
#issue_token ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/doorkeeper/oauth/authorization/code.rb', line 12 def issue_token @token ||= AccessGrant.create!( :application_id => pre_auth.client.id, :resource_owner_id => resource_owner.id, # # This is how we expire the document using couchbase # Used to be :expires_in => configuration.authorization_code_expires_in # :ttl => configuration., :redirect_uri => pre_auth.redirect_uri, :scopes => pre_auth.scopes.to_s ) end |