After the Red Hat OpenShift GitOps Operator is installed, Argo CD automatically creates a user with admin permissions. To manage multiple users, Argo CD allows cluster administrators to configure SSO.

Bundled Dex OIDC provider is not supported.

  • Red Hat SSO is installed on the cluster.

Creating a new client in Keycloak

  1. Log in to your Keycloak server, select the realm you want to use, navigate to the Clients page, and then click Create in the upper-right section of the screen.

  2. Specify the following values:

    Client ID


    Client Protocol


    Route URL


    Access Type


    Valid Redirect URIs


    Base URL


  3. Click Save to see the Credentials tab added to the Client page.

  4. Copy the secret from the Credentials tab for further configuration.

Configuring the groups claim

To manage users in Argo CD, you must configure a groups claim that can be included in the authentication token.

  1. In the Keycloak dashboard, navigate to Client Scope and add a new client with the following values:





    Display On Content Scope


    Include to Token Scope


  2. Click Save and navigate to groupsMappers.

  3. Add a new token mapper with the following values:



    Mapper Type

    Group Membership

    Token Claim Name


    The token mapper adds the groups claim to the token when the client requests groups.

  4. Navigate to ClientsClient Scopes and configure the client to provide the groups scope. Select groups in the Assigned Default Client Scopes table and click Add selected. The groups scope must be in the Available Client Scopes table.

  5. Navigate to UsersAdminGroups and create a group ArgoCDAdmins.

Configuring Argo CD OIDC

To configure Argo CD OpenID Connect (OIDC), you must generate your client secret, encode it, and add it to your custom resource.

  • You have obtained your client secret.

  1. Store the client secret you generated.

    1. Encode the client secret in base64:

      $ echo -n '83083958-8ec6-47b0-a411-a8c55381fbd2' | base64
    2. Edit the secret and add the base64 value to an oidc.keycloak.clientSecret key:

      $ oc edit secret argocd-secret -n <namespace>
      Example YAML of the secret
      apiVersion: v1
      kind: Secret
        name: argocd-secret
        oidc.keycloak.clientSecret: ODMwODM5NTgtOGVjNi00N2IwLWE0MTEtYThjNTUzODFmYmQy
  2. Edit the argocd custom resource and add the OIDC configuration to enable the Keycloak authentication:

    $ oc edit argocd -n <your_namespace>
    Example of argocd custom resource
    apiVersion: argoproj.io/v1alpha1
    kind: ArgoCD
      creationTimestamp: null
      name: argocd
      namespace: argocd
      resourceExclusions: |
        - apiGroups:
          - tekton.dev
          - '*'
          - TaskRun
          - PipelineRun
      oidcConfig: |
        name: OpenShift Single Sign-On
        issuer: https://keycloak.example.com/auth/realms/myrealm (1)
        clientID: argocd (2)
        clientSecret: $oidc.keycloak.clientSecret (3)
        requestedScopes: ["openid", "profile", "email", "groups"] (4)
          enabled: true
    1 issuer must end with the correct realm name (in this example myrealm).
    2 clientID is the Client ID you configured in your Keycloak account.
    3 clientSecret points to the right key you created in the argocd-secret secret.
    4 requestedScopes contains the groups claim if you did not add it to the Default scope.

Keycloak Identity Brokering with OpenShift

You can configure a Keycloak instance to use OpenShift for authentication through Identity Brokering. This allows for Single Sign-On (SSO) between the OpenShift cluster and the Keycloak instance.

  • jq CLI tool is installed.

  1. Obtain the OpenShift Container Platform API URL:

    $ curl -s -k -H "Authorization: Bearer $(oc whoami -t)" https://<openshift-user-facing-api-url>/apis/config.openshift.io/v1/infrastructures/cluster | jq ".status.apiServerURL".

    The address of the OpenShift Container Platform API is often protected by HTTPS. Therefore, you must configure X509_CA_BUNDLE in the container and set it to /var/run/secrets/kubernetes.io/serviceaccount/ca.crt. Otherwise, Keycloak cannot communicate with the API Server.

  2. In the Keycloak server dashboard, navigate to Identity Providers and select Openshift v4. Specify the following values:

    Base Url

    OpenShift 4 API URL

    Client ID


    Client Secret

    A secret that you want define

    Now you can log in to Argo CD with your OpenShift credentials through Keycloak as an Identity Broker.

Registering an additional an OAuth client

If you need an additional OAuth client to manage authentication for your OpenShift Container Platform cluster, you can register one.

  • To register your client:

    $ oc create -f <(echo '
    kind: OAuthClient
    apiVersion: oauth.openshift.io/v1
     name: keycloak-broker (1)
    secret: "..." (2)
    - "https://keycloak-keycloak.apps.dev-svc-4.7-020201.devcluster.openshift.com/auth/realms/myrealm/broker/openshift-v4/endpoint" (3)
    grantMethod: prompt (4)
1 The name of the OAuth client is used as the client_id parameter when making requests to <namespace_route>/oauth/authorize and <namespace_route>/oauth/token.
2 The secret is used as the client_secret parameter when making requests to <namespace_route>/oauth/token.
3 The redirect_uri parameter specified in requests to <namespace_route>/oauth/authorize and <namespace_route>/oauth/token must be equal to or prefixed by one of the URIs listed in the redirectURIs parameter value.
4 If the user has not granted access to this client, the grantMethod determines which action to take when this client requests tokens. Specify auto to automatically approve the grant and retry the request, or prompt to prompt the user to approve or deny the grant.

Configure groups and Argo CD RBAC

Role-based access control (RBAC) allows you to provide relevant permissions to users.

  • You have created the ArgoCDAdmins group in Keycloak.

  • The user you want to give permissions to has logged in to Argo CD.

  1. In the Keycloak dashboard navigate to UsersGroups. Add the user to the Keycloak group ArgoCDAdmins.

  2. Ensure that ArgoCDAdmins group has the required permissions in the argocd-rbac config map.

    • Edit the config map:

      $ oc edit configmap argocd-rbac-cm -n <namespace>
      Example of a config map that defines admin permissions.
      apiVersion: v1
      kind: ConfigMap
        name: argocd-rbac-cm
        policy.csv: |
          g, /ArgoCDAdmins, role:admin

In-built permissions for Argo CD

This section lists the permissions that are granted to ArgoCD to manage specific cluster-scoped resources which include cluster operators, optional OLM operators, and user management. Note that ArgoCD is not granted cluster-admin permissions.

Table 1. Permissions granted to Argo CD

Resource group

What it configures for a user or an administrator


Optional operators managed by OLM

user.openshift.io, rbac.authorization.k8s.io

Groups, Users, and their permissions


Control plane operators managed by CVO used to configure cluster-wide build configuration, registry configuration, and scheduler policies




Console customization