Class: AppleAuth::Conditions::IssCondition

Inherits:
Object
  • Object
show all
Defined in:
lib/apple_auth/helpers/conditions/iss_condition.rb

Constant Summary collapse

APPLE_ISS =
'https://appleid.apple.com'

Instance Method Summary collapse

Constructor Details

#initialize(jwt) ⇒ IssCondition

Returns a new instance of IssCondition.



8
9
10
# File 'lib/apple_auth/helpers/conditions/iss_condition.rb', line 8

def initialize(jwt)
  @iss = jwt['iss']
end

Instance Method Details

#validate!Object

Raises:



12
13
14
15
16
# File 'lib/apple_auth/helpers/conditions/iss_condition.rb', line 12

def validate!
  return true if @iss.include?(APPLE_ISS)

  raise JWTValidationError, 'jwt_iss is different to apple_iss'
end