Class: IMS::LTI::Services::AuthenticationService
- Inherits:
-
Object
- Object
- IMS::LTI::Services::AuthenticationService
- Defined in:
- lib/ims/lti/services/authentication_service.rb
Instance Attribute Summary collapse
-
#additional_claims ⇒ Object
Returns the value of attribute additional_claims.
-
#additional_params ⇒ Object
Returns the value of attribute additional_params.
-
#aud ⇒ Object
Returns the value of attribute aud.
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#grant_type ⇒ Object
Returns the value of attribute grant_type.
-
#iss ⇒ Object
Returns the value of attribute iss.
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#sub ⇒ Object
Returns the value of attribute sub.
Instance Method Summary collapse
- #access_token ⇒ Object
- #expiration ⇒ Object
- #expired? ⇒ Boolean
-
#initialize(iss:, aud:, sub:, secret:) ⇒ AuthenticationService
constructor
A new instance of AuthenticationService.
- #invalidate! ⇒ Object
Constructor Details
#initialize(iss:, aud:, sub:, secret:) ⇒ AuthenticationService
Returns a new instance of AuthenticationService.
8 9 10 11 12 13 14 15 16 |
# File 'lib/ims/lti/services/authentication_service.rb', line 8 def initialize(iss:, aud:, sub:, secret:) @iss = iss @aud = aud @sub = sub @secret = secret @additional_claims = {} @additional_params = {} @grant_type = 'urn:ietf:params:oauth:grant-type:jwt-bearer' end |
Instance Attribute Details
#additional_claims ⇒ Object
Returns the value of attribute additional_claims.
4 5 6 |
# File 'lib/ims/lti/services/authentication_service.rb', line 4 def additional_claims @additional_claims end |
#additional_params ⇒ Object
Returns the value of attribute additional_params.
4 5 6 |
# File 'lib/ims/lti/services/authentication_service.rb', line 4 def additional_params @additional_params end |
#aud ⇒ Object
Returns the value of attribute aud.
4 5 6 |
# File 'lib/ims/lti/services/authentication_service.rb', line 4 def aud @aud end |
#connection ⇒ Object
Returns the value of attribute connection.
4 5 6 |
# File 'lib/ims/lti/services/authentication_service.rb', line 4 def connection @connection end |
#grant_type ⇒ Object
Returns the value of attribute grant_type.
4 5 6 |
# File 'lib/ims/lti/services/authentication_service.rb', line 4 def grant_type @grant_type end |
#iss ⇒ Object
Returns the value of attribute iss.
4 5 6 |
# File 'lib/ims/lti/services/authentication_service.rb', line 4 def iss @iss end |
#secret ⇒ Object
Returns the value of attribute secret.
4 5 6 |
# File 'lib/ims/lti/services/authentication_service.rb', line 4 def secret @secret end |
#sub ⇒ Object
Returns the value of attribute sub.
4 5 6 |
# File 'lib/ims/lti/services/authentication_service.rb', line 4 def sub @sub end |
Instance Method Details
#access_token ⇒ Object
22 23 24 |
# File 'lib/ims/lti/services/authentication_service.rb', line 22 def access_token access_token_request['access_token'] end |
#expiration ⇒ Object
26 27 28 29 |
# File 'lib/ims/lti/services/authentication_service.rb', line 26 def expiration expires_in = access_token_request['expires_in'].to_i @_response_time + expires_in end |
#expired? ⇒ Boolean
31 32 33 |
# File 'lib/ims/lti/services/authentication_service.rb', line 31 def expired? expiration < Time.now end |
#invalidate! ⇒ Object
35 36 37 38 |
# File 'lib/ims/lti/services/authentication_service.rb', line 35 def invalidate! @_access_token_request = nil @_response_time = nil end |