Class: Core::Models::OAuth::Authorization
- Inherits:
-
Object
- Object
- Core::Models::OAuth::Authorization
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- lib/core/models/oauth/authorization.rb
Overview
An OAuth authorization is granted by a user to an application to access its personal data. The application then transforms it into an access token to be able to send it with further requests, so that we know the user has authorized the application to access its data.
Instance Attribute Summary collapse
-
#account ⇒ Arkaaan::Account
The account granting the authorization to access its data to the application.
-
#application ⇒ Core::Models::OAuth::Application
The application asking to access account's data.
-
#code ⇒ String
The value corresponding to the authentication code in the RFC of OAuth2.0, kep for historic purpose.
-
#token ⇒ Core::Models::OAuth::AccessToken
The access token used further in the application process to access private data of the account.
Instance Attribute Details
#account ⇒ Arkaaan::Account
Returns the account granting the authorization to access its data to the application.
21 |
# File 'lib/core/models/oauth/authorization.rb', line 21 belongs_to :account, class_name: 'Core::Models::Account', inverse_of: :authorizations |
#application ⇒ Core::Models::OAuth::Application
Returns the application asking to access account's data.
24 |
# File 'lib/core/models/oauth/authorization.rb', line 24 belongs_to :application, class_name: 'Core::Models::OAuth::Application', inverse_of: :authorizations |
#code ⇒ String
Returns the value corresponding to the authentication code in the RFC of OAuth2.0, kep for historic purpose.
17 |
# File 'lib/core/models/oauth/authorization.rb', line 17 field :code, type: String, default: ->{ SecureRandom.hex } |
#token ⇒ Core::Models::OAuth::AccessToken
Returns the access token used further in the application process to access private data of the account.
27 |
# File 'lib/core/models/oauth/authorization.rb', line 27 has_many :tokens, class_name: 'Core::Models::OAuth::AccessToken', inverse_of: :authorization |