Class: AppleAuth::Token

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

Constant Summary collapse

APPLE_AUD =
'https://appleid.apple.com'
APPLE_CONFIG =
AppleAuth.config
APPLE_CODE_TYPE =
'authorization_code'
APPLE_ALG =
'ES256'

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Token

Returns a new instance of Token.



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

def initialize(code)
  @code = code
end

Instance Method Details

#authenticate!Object

:reek:FeatureEnvy



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

def authenticate!
  access_token = apple_access_token
  access_token.refresh! if access_token.expired?

  reponse_hash(access_token)
end