IBM Cloud: How to change session expiration?

149 views Asked by At

I am using IBM Cloud and sometimes when coming back from a coffee break I have to enter my credentials again. Is there a way to change the session expiration time? Could it be done programmatically?

1

There are 1 answers

0
data_henrik On BEST ANSWER

The settings can be changed either in the IBM Cloud console (UI) or via REST API. In the UI you have to access the Identity and Access Management (IAM) settings. IBM Cloud IAM settings

The IBM Cloud API docs have a section for the platform services. There, the IAM services can be found. They have an API to fetch the current account settings and update the account settings. It includes the configuration values for session_expiration_in_seconds and session_invalidation_in_seconds to control the session expiration. You could use curl to update the settings like this:

curl -X PUT 'https://iam.cloud.ibm.com/v1/accounts/ACCOUNT_ID/settings/identity' 
-H 'Authorization: Bearer TOKEN' -H 'Content-Type: application/json'
-d '{
  "session_expiration_in_seconds": 3600,
  "session_invalidation_in_seconds": 1800
}'