You can revoke the API key for usage metering and generate a new key.
Important: If you generate a new usage metering API key, then you must update your Liberty and WebSphere Application Server
server configurations to use the new API key.
About this task
The product supports one usage metering API key. You can revoke the usage metering API key and
generate a new one by deleting the secret and the service account that is associated with it. Use
the Red Hat OpenShift console or CLI (oc) commands to
delete the service account.
The service account name uses the
WebSphereSecure_CR_name-metering-apis-sa naming convention,
where WebSphereSecure_CR_name is the WebSphereSecure custom
resource name.
The token that is used for the usage metering API key is encrypted with an AES key. The operator
generates and stores this key inside a secret named
WebSphereSecure_CR_name-crypto. Deleting this secret causes a
new encryption key to be generated, and also changes the usage metering API key. Recall that if you
change the usage metering API key, you must update your Liberty and WebSphere Application Server
server configurations to use the new API key.
Procedure
- Generate a usage metering API key with the Red Hat OpenShift
console.
- Optional: To generate a new encryption key and change the usage metering
API key, delete the AES key that is used to encrypt the token for the usage metering API key.
- Click
.
- In the search field, type crypto.
- Select the secret with the name
WebSphereSecure_CR_name-crypto (where
WebSphereSecure_CR_name is the name of the WebSphereSecure
custom resource).
- Click .
- Click .
- From the list of service accounts, find the usage metering service
account.
You can filter the list of service accounts by entering
metering-apis-sa into the search field.
- Delete the service account. Click
.
- Generate a usage metering API key with the Red Hat OpenShift
CLI.
- Optional: Get the usage metering service account name.
oc get serviceaccount | grep metering-apis-sa
- Optional: To generate a new encryption key and change the usage metering
API key, delete the AES key that is used to encrypt the token for the usage metering API key.
Replace WebSphereSecure_CR_name with the name of the
WebSphereSecure custom resource and then run the delete command.
oc delete secret WebSphereSecure_CR_name-crypto
The following example shows the command when the WebSphereSecure custom resource name is
wsa-secure.
oc delete secret wsa-secure-crypto
- Delete the service account.
Replace WebSphereSecure_CR_name with the name of the
WebSphereSecure custom resource and then run the delete command.
oc delete serviceaccount WebSphereSecure_CR_name-metering-apis-sa
The following example shows the command when the WebSphereSecure custom resource name is
wsa-secure and the service account name is
wsa-secure-metering-apis-sa.
oc delete serviceaccount wsa-secure-metering-apis-sa
Results
After successful deletion of the service account, the serviceaccount
"WebSphereSecure_CR_name-metering-apis-sa" deleted message is shown and
the operator generates a new service account with the same name.
A new encrypted token value is generated in the
WebSphereSecure_CR_name-metering-apis-encrypted-tokens
secret.