Class: EtCcdClient::IdamClient
- Inherits:
-
Object
- Object
- EtCcdClient::IdamClient
- Includes:
- CommonRestClient
- Defined in:
- lib/et_ccd_client/idam_client.rb
Instance Attribute Summary collapse
-
#service_token ⇒ Object
readonly
Returns the value of attribute service_token.
-
#user_details ⇒ Object
readonly
Returns the value of attribute user_details.
-
#user_token ⇒ Object
readonly
Returns the value of attribute user_token.
Instance Method Summary collapse
-
#initialize(config: ::EtCcdClient.config) ⇒ IdamClient
constructor
A new instance of IdamClient.
- #login(username: config.sidam_username, password: config.sidam_password) ⇒ Object
Methods included from CommonRestClient
Constructor Details
#initialize(config: ::EtCcdClient.config) ⇒ IdamClient
Returns a new instance of IdamClient.
11 12 13 14 15 16 17 |
# File 'lib/et_ccd_client/idam_client.rb', line 11 def initialize(config: ::EtCcdClient.config) self.config = config self.logger = config.logger self.service_token = nil self.user_token = nil self.user_details = nil end |
Instance Attribute Details
#service_token ⇒ Object
Returns the value of attribute service_token.
9 10 11 |
# File 'lib/et_ccd_client/idam_client.rb', line 9 def service_token @service_token end |
#user_details ⇒ Object
Returns the value of attribute user_details.
9 10 11 |
# File 'lib/et_ccd_client/idam_client.rb', line 9 def user_details @user_details end |
#user_token ⇒ Object
Returns the value of attribute user_token.
9 10 11 |
# File 'lib/et_ccd_client/idam_client.rb', line 9 def user_token @user_token end |
Instance Method Details
#login(username: config.sidam_username, password: config.sidam_password) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/et_ccd_client/idam_client.rb', line 19 def login(username: config.sidam_username, password: config.sidam_password) logger.tagged('EtCcdClient::IdamClient') do self.service_token = exchange_service_token self.user_token = exchange_sidam_user_token(username, password) self.user_details = fetch_user_details end end |