Class: ADAL::UserInformation
- Inherits:
-
Object
- Object
- ADAL::UserInformation
- Defined in:
- lib/adal/user_information.rb
Overview
Basically just a holder for the id token.
Constant Summary collapse
- ID_TOKEN_FIELDS =
[:aud, :iss, :iat, :nbf, :exp, :ver, :tid, :oid, :upn, :sub, :given_name, :family_name, :name, :amr, :unique_name, :nonce, :email]
Instance Attribute Summary collapse
-
#displayable_id ⇒ Object
readonly
Returns the value of attribute displayable_id.
-
#unique_id ⇒ Object
readonly
Returns the value of attribute unique_id.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(claims) ⇒ UserInformation
constructor
Constructs a new UserInformation.
Constructor Details
#initialize(claims) ⇒ UserInformation
Constructs a new UserInformation.
39 40 41 42 43 |
# File 'lib/adal/user_information.rb', line 39 def initialize(claims) claims.each { |k, v| instance_variable_set("@#{k}", v) } @unique_id = oid || sub || unique_id @displayable_id = upn || email end |
Instance Attribute Details
#displayable_id ⇒ Object (readonly)
Returns the value of attribute displayable_id.
31 32 33 |
# File 'lib/adal/user_information.rb', line 31 def displayable_id @displayable_id end |
#unique_id ⇒ Object (readonly)
Returns the value of attribute unique_id.
30 31 32 |
# File 'lib/adal/user_information.rb', line 30 def unique_id @unique_id end |
Instance Method Details
#==(other) ⇒ Object
45 46 47 |
# File 'lib/adal/user_information.rb', line 45 def ==(other) unique_id == other.unique_id && displayable_id == other.displayable_id end |