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.

  1. Get ssc shturval-auth and 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
  1. Remove the status section, parameters and their values from shturval-auth-ssc.yaml:
Deleted parameters
 creationTimestamp:
 resourceVersion:
 uid: 
 finalizers:
 generation:
 annotations: 
  1. Prepare a YAML file with a ShturvalServicePatch (PatchSSC) object manifest to apply to the specification (ssc) shturval-auth. In PatchSSC, set the required parameters in customvalues using 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>
ParameterDescriptionData typeExample
metadata.nameName of the created PatchSSCstringshturval-auth-keycloak
AUTH_EXTERNAL_IDP_SECRET_BASE64External provider configuration, encoded in base64, obtained during the preparation stage for setting up an external service connectionstringbase64*
AUTH_IDP_ACTIVEConnecting an external authentication provider. If you need to disable Keycloak, just set false in this parameterbooleantrue
SKIP_INTERNAL_AUTH_FORMPossibility 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 availablebooleantrue

*ewogICJuYW1lIjogImtleWNsb2FrIiwgCiAgImlzc3VlclVybCI6ICJodHRwczovL2tleWNsb2FrLmlwLVhYLVhYLVhYLVhYLnNodHVydmFsLmxpbmsvcmVhbG1zL3NodHVydmFsIiwgCiAgImNvZGVWZXJpZnlNZXRob2QiOiAiUzI1NiIsIAogICJjbGllbnQiOiB7CiAgICAiY2xpZW50SWQiOiAic2h0dXJ2YWxfdW5pa2V5Y2xvYWtfYmFja2VuZF9jbGllbnRfaWQiLCAKICAgICJjbGllbnRTZWNyZXQiOiAiSEcwcnhKTUtvcG1BR1Nhc0R4RHRrSllRSCIgCiAgfSwKICAiaW5zZWN1cmVTa2lwVmVyaWZ5IjogdHJ1ZSwgCiAgImNhQnVuZGxlIjogIkxTMHRMUzFDUlVkSlRpQkRSVkpVU1VaSlEwRlVSUzB0TFMwdENsdlJnZEMxMFlEUmd0QzQwWVRRdU5DNjBMRFJnaURRc3RDOTBMWFJpTkM5MExYUXM5QytJTkdCMExYUmdOQ3kwTGpSZ2RDd0lOQ3cwWVBSZ3RDMTBMM1JndEM0MFlUUXVOQzYwTERSaHRDNDBMaGRDaTB0TFMwdFJVNUVJRU5GVWxSSlJrbERRVlJGTFMwdExTMD0iICAKfQ==

  1. Apply changes:
Command
kubectl apply -f SPECIFY-PATCHSSC-MANIFEST-FILE

An example manifest file name is shturval-auth-keycloak.yaml.

  1. Wait for the changes to apply. In the namespace shturval-backend, check the details of Secret auth-idps. It must contain the configuration specified in AUTH_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

  1. Prepare a ShturvalServicePatch (PatchSSC) object manifest to apply to specification (ssc) shturval-auth. In PatchSSC, set the required parameters in customvalues as 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>
ParameterDescriptionData typeExample
metadata.nameName of the created PatchSSCstringshturval-auth-keycloak
AUTH_EXTERNAL_IDP_SECRET_BASE64External provider configuration, encoded in base64stringbase64*
AUTH_IDP_ACTIVEConnecting an external authentication provider. If you need to disable Keycloak, just set false in this parameterbooleantrue
SKIP_INTERNAL_AUTH_FORMPossibility 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 externalbooleantrue

**ewogICJuYW1lIjogImtleWNsb2FrIiwgCiAgImlzc3VlclVybCI6ICJodHRwczovL2tleWNsb2FrLmlwLVhYLVhYLVhYLVhYLnNodHVydmFsLmxpbmsvcmVhbG1zL3NodHVydmFsIiwgCiAgImNvZGVWZXJpZnlNZXRob2QiOiAiUzI1NiIsIAogICJjbGllbnQiOiB7CiAgICAiY2xpZW50SWQiOiAic2h0dXJ2YWxfdW5pa2V5Y2xvYWtfYmFja2VuZF9jbGllbnRfaWQiLCAKICAgICJjbGllbnRTZWNyZXQiOiAiSEcwcnhKTUtvcG1BR1Nhc0R4RHRrSllRSCIgCiAgfSwKICAiaW5zZWN1cmVTa2lwVmVyaWZ5IjogdHJ1ZSwgCiAgImNhQnVuZGxlIjogIkxTMHRMUzFDUlVkSlRpQkRSVkpVU1VaSlEwRlVSUzB0TFMwdENsdlJnZEMxMFlEUmd0QzQwWVRRdU5DNjBMRFJnaURRc3RDOTBMWFJpTkM5MExYUXM5QytJTkdCMExYUmdOQ3kwTGpSZ2RDd0lOQ3cwWVBSZ3RDMTBMM1JndEM0MFlUUXVOQzYwTERSaHRDNDBMaGRDaTB0TFMwdFJVNUVJRU5GVWxSSlJrbERRVlJGTFMwdExTMD0iICAKfQ==

  1. In the management cluster, load the prepared ShturvalServicePatch using import manifests.

  2. 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.

  3. In namespace shturval-backend, check the details of Secret auth-idps. Secret must contain the configuration specified in AUTH_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.