Class: Arkaan::OAuth::AccessToken

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/arkaan/oauth/access_token.rb

Overview

An access token is the value assigned to the application to access the private data of an account.

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#authorizationArkaan::OAuth::Authorization

Returns the authorization code that issued this token to the application for this user.

Returns:



18
# File 'lib/arkaan/oauth/access_token.rb', line 18

belongs_to :authorization, class_name: 'Arkaan::OAuth::Authorization', inverse_of: :access_token

#expirationInteger

Returns the time, in seconds, after which the token is declared expired, and thus can’t be used anymore.

Returns:

  • (Integer)

    the time, in seconds, after which the token is declared expired, and thus can’t be used anymore.



14
# File 'lib/arkaan/oauth/access_token.rb', line 14

field :expiration, type: Integer, default: 86400

#valueString

Returns the value of the token, returned to the application when built.

Returns:

  • (String)

    the value of the token, returned to the application when built.



11
# File 'lib/arkaan/oauth/access_token.rb', line 11

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