Class: IapAuthenticator::IapAuth

Inherits:
Object
  • Object
show all
Defined in:
lib/iap_authenticator/iap_auth.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeIapAuth

Returns a new instance of IapAuth.



4
5
6
7
8
9
10
# File 'lib/iap_authenticator/iap_auth.rb', line 4

def initialize
 @configuration = IapAuthenticator.configuration
 json_from_file = File.read(@configuration.)
  = JSON.parse(json_from_file)
 private_key = IapAuthenticator::Pkey.parse(['private_key'])
 @jws = IapAuthenticator::JWS.new(private_key, @configuration.refresh_time_seconds, ['client_email'], @configuration.client_id)
end

Instance Attribute Details

#jwsObject (readonly)

Returns the value of attribute jws.



3
4
5
# File 'lib/iap_authenticator/iap_auth.rb', line 3

def jws
  @jws
end

Instance Method Details

#tokenObject



12
13
14
15
16
# File 'lib/iap_authenticator/iap_auth.rb', line 12

def token
 assertion = self.jws.assertion
 token = IapAuthenticator::Token.generate_bearer_token( assertion)
 return token
end