Este conteúdo não está disponível no idioma selecionado.
Chapter 8. Configuring authentication
Application users need credentials to access Data Grid clusters. You can use default, generated credentials or add your own.
8.1. Default credentials Copiar o linkLink copiado para a área de transferência!
Data Grid Operator generates base64-encoded credentials for the following users:
| User | Secret name | Description |
|---|---|---|
|
|
| Credentials for the default application user. |
|
|
| Credentials that Data Grid Operator uses to interact with Data Grid resources. |
8.2. Retrieving credentials Copiar o linkLink copiado para a área de transferência!
Get credentials from authentication secrets to access Data Grid clusters.
Procedure
Retrieve credentials from authentication secrets.
oc get secret infinispan-generated-secret
oc get secret infinispan-generated-secretCopy to Clipboard Copied! Toggle word wrap Toggle overflow Base64-decode credentials.
oc get secret infinispan-generated-secret -o jsonpath="{.data.identities\.yaml}" | base64 --decodeoc get secret infinispan-generated-secret -o jsonpath="{.data.identities\.yaml}" | base64 --decodeCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.3. Adding custom user credentials Copiar o linkLink copiado para a área de transferência!
Configure access to Data Grid cluster endpoints with custom credentials.
Modifying spec.security.endpointSecretName triggers a cluster restart.
Procedure
Create an
identities.yamlfile with the credentials that you want to add.credentials: - username: myfirstusername password: changeme-one - username: mysecondusername password: changeme-two
credentials: - username: myfirstusername password: changeme-one - username: mysecondusername password: changeme-twoCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create an authentication secret from
identities.yaml.oc create secret generic --from-file=identities.yaml connect-secret
oc create secret generic --from-file=identities.yaml connect-secretCopy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the authentication secret with
spec.security.endpointSecretNamein yourInfinispanCR and then apply the changes.spec: security: endpointSecretName: connect-secretspec: security: endpointSecretName: connect-secretCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.4. Changing the operator password Copiar o linkLink copiado para a área de transferência!
You can change the password for the operator user if you do not want to use the automatically generated password.
Procedure
Update the
passwordkey in theinfinispan-generated-operator-secretsecret as follows:oc patch secret infinispan-generated-operator-secret -p='{"stringData":{"password": "supersecretoperatorpassword"}}'oc patch secret infinispan-generated-operator-secret -p='{"stringData":{"password": "supersecretoperatorpassword"}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou should update only the
passwordkey in thegenerated-operator-secretsecret. When you update the password, Data Grid Operator automatically refreshes other keys in that secret.
8.5. Disabling user authentication Copiar o linkLink copiado para a área de transferência!
Allow users to access Data Grid clusters and manipulate data without providing credentials.
Do not disable authentication if endpoints are accessible from outside the OpenShift cluster via spec.expose.type. You should disable authentication for development environments only.
Procedure
Set
falseas the value for thespec.security.endpointAuthenticationfield in yourInfinispanCR.spec: security: endpointAuthentication: falsespec: security: endpointAuthentication: falseCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Apply the changes.