Class: AppleAuth::UserIdentity

Inherits:
Object
  • Object
show all
Defined in:
lib/apple_auth/user_identity.rb

Constant Summary collapse

APPLE_KEY_URL =
'https://appleid.apple.com/auth/keys'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_identity, jwt) ⇒ UserIdentity

Returns a new instance of UserIdentity.



9
10
11
12
# File 'lib/apple_auth/user_identity.rb', line 9

def initialize(user_identity, jwt)
  @user_identity = user_identity
  @jwt = jwt
end

Instance Attribute Details

#jwtObject (readonly)

Returns the value of attribute jwt.



7
8
9
# File 'lib/apple_auth/user_identity.rb', line 7

def jwt
  @jwt
end

#user_identityObject (readonly)

Returns the value of attribute user_identity.



7
8
9
# File 'lib/apple_auth/user_identity.rb', line 7

def user_identity
  @user_identity
end

Instance Method Details

#validate!Object



14
15
16
17
18
19
20
# File 'lib/apple_auth/user_identity.rb', line 14

def validate!
  token_data = decoded_jwt

  JWTConditions.new(user_identity, token_data).validate!

  token_data.symbolize_keys
end