Class: KeycloakOauth::AuthenticationServiceBase
- Inherits:
-
Object
- Object
- KeycloakOauth::AuthenticationServiceBase
- Defined in:
- app/services/keycloak_oauth/authentication_service_base.rb
Direct Known Subclasses
Constant Summary collapse
- ACCESS_TOKEN_KEY =
'access_token'.freeze
- ACCESS_TOKEN_EXPIRES_IN =
'expires_in'.freeze
- REFRESH_TOKEN_KEY =
'refresh_token'.freeze
- REFRESH_TOKEN_EXPIRES_IN =
'refresh_expires_in'.freeze
Instance Attribute Summary collapse
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #authenticate ⇒ Object
-
#initialize(session:) ⇒ AuthenticationServiceBase
constructor
A new instance of AuthenticationServiceBase.
Constructor Details
#initialize(session:) ⇒ AuthenticationServiceBase
Returns a new instance of AuthenticationServiceBase.
10 11 12 |
# File 'app/services/keycloak_oauth/authentication_service_base.rb', line 10 def initialize(session:) @session = session end |
Instance Attribute Details
#session ⇒ Object (readonly)
Returns the value of attribute session.
8 9 10 |
# File 'app/services/keycloak_oauth/authentication_service_base.rb', line 8 def session @session end |
Instance Method Details
#authenticate ⇒ Object
14 15 16 17 18 19 |
# File 'app/services/keycloak_oauth/authentication_service_base.rb', line 14 def authenticate request_time = Time.zone.now post_token_service = post_service_name.new(**post_service_arguments) post_token_service.perform store_credentials_in_session(post_token_service, request_time) end |