Keycloak
На этой странице
Once you have completed the steps to prepare for setting up a connection in the platform (the configuration of the external authentication service has been received), you can make changes to the ssc of the Authentication Management Module (shturval-auth) from the command line interface or from the GUI.
It is recommended to connect external authentication services from the command line interface (console).
Connect from the command line interface
Log in to the “Shturval” platform using the kubeconfig received during platform installation, or you can take it from the Control Plane of the /etc/kubernetes/admin.conf platform node.
- Get ssc
shturval-authand save the original ssc so you can quickly roll back changes in case of an error:
Command
# Get shturval-auth ssc
kubectl get ssc shturval-auth -o yaml > shturval-auth-ssc.yaml
# Save the original ssc
cp shturval-auth-ssc.yaml shturval-auth-ssc.yaml.backup
- Remove the
statussection, parameters and their values from shturval-auth-ssc.yaml:
Deleted parameters
creationTimestamp:
resourceVersion:
uid:
finalizers:
generation:
annotations:
- Prepare a YAML file with a ShturvalServicePatch (PatchSSC) object manifest to apply to the specification (ssc)
shturval-auth. In PatchSSC, set the required parameters incustomvaluesusing your parameter values.
Example ShturvalServicePatch
apiVersion: ops.shturval.tech/v1beta2
kind: ShturvalServicePatch
metadata:
name: <resource name>
spec:
shturvalServiceConfigName: shturval-auth
customvalues:
AUTH_EXTERNAL_IDP_SECRET_BASE64: <your parameter value>
AUTH_IDP_ACTIVE: <your parameter value>
SKIP_INTERNAL_AUTH_FORM: <your parameter value>
| Parameter | Description | Data type | Example |
|---|---|---|---|
metadata.name | Name of the created PatchSSC | string | shturval-auth-keycloak |
AUTH_EXTERNAL_IDP_SECRET_BASE64 | External provider configuration, encoded in base64, obtained during the preparation stage for setting up an external service connection | string | base64* |
AUTH_IDP_ACTIVE | Connecting an external authentication provider. If you need to disable Keycloak, just set false in this parameter | boolean | true |
SKIP_INTERNAL_AUTH_FORM | Possibility of authentication in a graphical interface with an external service. If this parameter is not set or its value is false, then both external and internal services will be available for authentication. If the value is true, only the external service will be available | boolean | true |
*ewogICJuYW1lIjogImtleWNsb2FrIiwgCiAgImlzc3VlclVybCI6ICJodHRwczovL2tleWNsb2FrLmlwLVhYLVhYLVhYLVhYLnNodHVydmFsLmxpbmsvcmVhbG1zL3NodHVydmFsIiwgCiAgImNvZGVWZXJpZnlNZXRob2QiOiAiUzI1NiIsIAogICJjbGllbnQiOiB7CiAgICAiY2xpZW50SWQiOiAic2h0dXJ2YWxfdW5pa2V5Y2xvYWtfYmFja2VuZF9jbGllbnRfaWQiLCAKICAgICJjbGllbnRTZWNyZXQiOiAiSEcwcnhKTUtvcG1BR1Nhc0R4RHRrSllRSCIgCiAgfSwKICAiaW5zZWN1cmVTa2lwVmVyaWZ5IjogdHJ1ZSwgCiAgImNhQnVuZGxlIjogIkxTMHRMUzFDUlVkSlRpQkRSVkpVU1VaSlEwRlVSUzB0TFMwdENsdlJnZEMxMFlEUmd0QzQwWVRRdU5DNjBMRFJnaURRc3RDOTBMWFJpTkM5MExYUXM5QytJTkdCMExYUmdOQ3kwTGpSZ2RDd0lOQ3cwWVBSZ3RDMTBMM1JndEM0MFlUUXVOQzYwTERSaHRDNDBMaGRDaTB0TFMwdFJVNUVJRU5GVWxSSlJrbERRVlJGTFMwdExTMD0iICAKfQ==
- Apply changes:
Command
kubectl apply -f SPECIFY-PATCHSSC-MANIFEST-FILE
An example manifest file name is shturval-auth-keycloak.yaml.
- Wait for the changes to apply. In the namespace
shturval-backend, check the details of Secretauth-idps. It must contain the configuration specified inAUTH_EXTERNAL_IDP_SECRET_BASE64.
Command
kubectl get secret auth-idps -n shturval-backend -o yaml
Once the changes are applied, to access the cluster using kubeconfig, download and use the new kubeconfig. Learn more about how to get kubeconfig on the Cluster Actions page.
Connect from GUI
- Prepare a ShturvalServicePatch (PatchSSC) object manifest to apply to specification (ssc)
shturval-auth. In PatchSSC, set the required parameters incustomvaluesas in the example below, using your values.
Example ShturvalServicePatch
apiVersion: ops.shturval.tech/v1beta2
kind: ShturvalServicePatch
metadata:
name: <resource name>
spec:
shturvalServiceConfigName: shturval-auth
customvalues:
AUTH_EXTERNAL_IDP_SECRET_BASE64: <your parameter value>
AUTH_IDP_ACTIVE: <your parameter value>
SKIP_INTERNAL_AUTH_FORM: <your parameter value>
| Parameter | Description | Data type | Example |
|---|---|---|---|
metadata.name | Name of the created PatchSSC | string | shturval-auth-keycloak |
AUTH_EXTERNAL_IDP_SECRET_BASE64 | External provider configuration, encoded in base64 | string | base64* |
AUTH_IDP_ACTIVE | Connecting an external authentication provider. If you need to disable Keycloak, just set false in this parameter | boolean | true |
SKIP_INTERNAL_AUTH_FORM | Possibility of authentication in a graphical interface with an external service. If this parameter is not set or its value is false, then external and internal services will be available for authentication. If the value is true, only external | boolean | true |
**ewogICJuYW1lIjogImtleWNsb2FrIiwgCiAgImlzc3VlclVybCI6ICJodHRwczovL2tleWNsb2FrLmlwLVhYLVhYLVhYLVhYLnNodHVydmFsLmxpbmsvcmVhbG1zL3NodHVydmFsIiwgCiAgImNvZGVWZXJpZnlNZXRob2QiOiAiUzI1NiIsIAogICJjbGllbnQiOiB7CiAgICAiY2xpZW50SWQiOiAic2h0dXJ2YWxfdW5pa2V5Y2xvYWtfYmFja2VuZF9jbGllbnRfaWQiLCAKICAgICJjbGllbnRTZWNyZXQiOiAiSEcwcnhKTUtvcG1BR1Nhc0R4RHRrSllRSCIgCiAgfSwKICAiaW5zZWN1cmVTa2lwVmVyaWZ5IjogdHJ1ZSwgCiAgImNhQnVuZGxlIjogIkxTMHRMUzFDUlVkSlRpQkRSVkpVU1VaSlEwRlVSUzB0TFMwdENsdlJnZEMxMFlEUmd0QzQwWVRRdU5DNjBMRFJnaURRc3RDOTBMWFJpTkM5MExYUXM5QytJTkdCMExYUmdOQ3kwTGpSZ2RDd0lOQ3cwWVBSZ3RDMTBMM1JndEM0MFlUUXVOQzYwTERSaHRDNDBMaGRDaTB0TFMwdFJVNUVJRU5GVWxSSlJrbERRVlJGTFMwdExTMD0iICAKfQ==
In the management cluster, load the prepared ShturvalServicePatch using import manifests.
If after applying PatchSSC the session in the platform’s graphical interface is completed, connect to the platform from the console. Use the management cluster kubeconfig. If the authentication was not interrupted, you can continue with the following steps in the GUI.
In namespace
shturval-backend, check the details of Secretauth-idps. Secret must contain the configuration specified inAUTH_EXTERNAL_IDP_SECRET_BASE64.
After applying the changes to access the cluster using kubeconfig, download and use the new kubeconfig. Read more about ways to get kubeconfig on the pageCluster Actions.