Class: Arkaan::OAuth::Authorization

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/arkaan/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.

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#accountArkaaan::Account

Returns the account granting the authorization to access its data to the application.

Returns:

  • (Arkaaan::Account)

    the account granting the authorization to access its data to the application.



20
# File 'lib/arkaan/oauth/authorization.rb', line 20

belongs_to :account, class_name: 'Arkaan::Account', inverse_of: :authorizations

#applicationArkaan::OAuth::Application

Returns the application asking to access account’s data.

Returns:



23
# File 'lib/arkaan/oauth/authorization.rb', line 23

belongs_to :application, class_name: 'Arkaan::OAuth::Application', inverse_of: :authorizations

#codeString

Returns the value corresponding to the authentication code in the RFC of OAuth2.0.

Returns:

  • (String)

    the value corresponding to the authentication code in the RFC of OAuth2.0.



16
# File 'lib/arkaan/oauth/authorization.rb', line 16

field :code, type: String, default: -> { SecureRandom.hex }

#tokenArkaan::OAuth::AccessToken

Returns the access token used further in the application process to access data.

Returns:



26
# File 'lib/arkaan/oauth/authorization.rb', line 26

has_many :tokens, class_name: 'Arkaan::OAuth::AccessToken', inverse_of: :authorization