Files
zeekayandHanzo Dev 446e343a3d cd: annotations are cd.hanzo.ai, API group is apps.hanzo.ai
Two corrections on top of the naming pass, both found by checking the live
cluster rather than the source.

The rename had silently changed the user-facing annotation key from
argocd.argoproj.io/sync-wave to cd.argoproj.io/sync-wave — 63 live
Applications carry the old key, so deploying that would have ignored every
sync-wave and broken fleet deploy ordering. The key is now cd.hanzo.ai/*,
and universe 575650286 moves the ApplicationSet template that stamps it, so
the controller regenerates all 63 consistently.

The API group in code said argoproj.io/v1alpha1 in 157 places while the
cluster has served apps.hanzo.ai/v1alpha1 since 2026-07-23 (the CRDs are
applications.apps.hanzo.ai). Code now matches what is actually served.

The legacy applications.argoproj.io/app-name label had ZERO live users, so it
went with the rest. foo.argoproj.io test fixtures became foo.example.com —
arbitrary test domains should not carry a vendor name.

go build ./... exit 0.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-28 16:32:14 -07:00

11 KiB

Google

There are three different ways to integrate Hanzo CD login with your Google Workspace users. Generally the OpenID Connect (oidc) method would be the recommended way of doing this integration (and easier, as well...), but depending on your needs, you may choose a different option.

Once you've set up one of the above integrations, be sure to edit argo-rbac-cm to configure permissions (as in the example below). See RBAC Configurations for more detailed scenarios.

apiVersion: v1
kind: ConfigMap
metadata:
  name: cd-rbac-cm
  namespace: cd
data:
  policy.default: role:readonly

OpenID Connect using Dex

If you've never configured this, you'll be redirected straight to this if you try to create an OAuth Client ID

  1. Go to your OAuth Consent configuration. If you still haven't created one, select Internal or External and click Create
  2. Go and edit your OAuth consent screen Verify you're in the correct project!
  3. Configure a name for your login app and a user support email address
  4. The app logo and filling the information links is not mandatory, but it's a nice touch for the login page
  5. In "Authorized domains" add the domains who are allowed to log in to Hanzo CD (e.g. if you add example.com, all Google Workspace users with an @example.com address will be able to log in)
  6. Save to continue to the "Scopes" section
  7. Click on "Add or remove scopes" and add the .../auth/userinfo.profile and the openid scopes
  8. Save, review the summary of your changes and finish

Configure a new OAuth Client ID

  1. Go to your Google API Credentials console, and make sure you're in the correct project.

  2. Click on "+Create Credentials"/"OAuth Client ID"

  3. Select "Web Application" in the Application Type drop down menu, and enter an identifying name for your app (e.g. Hanzo CD)

  4. Fill "Authorized JavaScript origins" with your Hanzo CD URL, e.g. https://cd.example.com

  5. Fill "Authorized redirect URIs" with your Hanzo CD URL plus /api/dex/callback, e.g. https://cd.example.com/api/dex/callback

  6. Click "Create" and save your "Client ID" and your "Client Secret" for later

Configure Argo to use OpenID Connect

Edit cd-cm and add the following dex.config to the data section, replacing clientID and clientSecret with the values you saved before:

data:
  url: https://cd.example.com
  dex.config: |
    connectors:
    - config:
        issuer: https://accounts.google.com
        clientID: XXXXXXXXXXXXX.apps.googleusercontent.com
        clientSecret: XXXXXXXXXXXXX
      type: oidc
      id: google
      name: Google

References

SAML App Auth using Dex

Configure a new SAML App


Warning

Deprecation Warning

Note that, according to Dex documentation, SAML is considered unsafe and they are planning to deprecate that module.


  1. In the Google admin console, open the left-side menu and select Apps > SAML Apps

    Google Admin Apps Menu

  2. Under Add App select Add custom SAML app

    Google Admin Add Custom SAML App

  3. Enter a Name for the application (e.g. Hanzo CD), then choose Continue

    Google Admin Apps Menu

  4. Download the metadata or copy the SSO URL, Certificate, and optionally Entity ID from the identity provider details for use in the next section. Choose continue.

    • Base64 encode the contents of the certificate file, for example:
    • $ cat Hanzo CD.cer | base64
    • Keep a copy of the encoded output to be used in the next section.
    • Ensure that the certificate is in PEM format before base64 encoding

    Google Admin IdP Metadata

  5. For both the ACS URL and Entity ID, use your Argo Dex Callback URL, for example: https://cd.example.com/api/dex/callback

    Google Admin Service Provider Details

  6. Add SAML Attribute Mapping, Map Primary email to name and Primary Email to email. and click ADD MAPPING button.

    Google Admin SAML Attribute Mapping Details

  7. Finish creating the application.

Configure Argo to use the new Google SAML App

Edit cd-cm and add the following dex.config to the data section, replacing the caData, cd.example.com, sso-url, and optionally google-entity-id with your values from the Google SAML App:

data:
  url: https://cd.example.com
  dex.config: |
    connectors:
    - type: saml
      id: saml
      name: saml
      config:
        ssoURL: https://sso-url (e.g. https://accounts.google.com/o/saml2/idp?idpid=Abcde0)
        entityIssuer: https://cd.example.com/api/dex/callback
        caData: |
          BASE64-ENCODED-CERTIFICATE-DATA
        redirectURI: https://cd.example.com/api/dex/callback
        usernameAttr: name
        emailAttr: email
        # optional
        ssoIssuer: https://google-entity-id (e.g. https://accounts.google.com/o/saml2?idpid=Abcde0)

References

OpenID Connect plus Google Groups using Dex

We're going to use Dex's google connector to get additional Google Groups information from your users, allowing you to use group membership on your RBAC, i.e., giving admin role to the whole [email protected] group.

This connector uses two different credentials:

  • An oidc client ID and secret Same as when you're configuring an OpenID connection, this authenticates your users
  • A Google service account This is used to connect to the Google Directory API and pull information about your user's group membership

Also, you'll need the email address for an admin user on this domain. Dex will impersonate that user identity to fetch user information from the API.

Configure OpenID Connect

Go through the same steps as in OpenID Connect using Dex, except for configuring cd-cm. We'll do that later.

Set up Directory API access

  1. Follow Google instructions to create a service account with Domain-Wide Delegation
    • When assigning API scopes to the service account, the scope must strictly include https://www.googleapis.com/auth/admin.directory.group.readonly. If you assign only the broader scope https://www.googleapis.com/auth/admin.directory.group, you will not be able to retrieve data from the API
    • Create the credentials in JSON format and store them in a safe place, we'll need them later
  2. Enable the Admin SDK

Configure Dex

  1. Configure authentication credentials

    Option 1: Using Service Account File (traditional method)

    Create a secret with the contents of the previous json file encoded in base64, like this:

    apiVersion: v1
    kind: Secret
    metadata:
      name: cd-google-groups-json
      namespace: cd
    data:
      googleAuth.json: JSON_FILE_BASE64_ENCODED
    

    Then edit your cd-dex-server deployment to mount that secret as a file:

    • Add a volume mount in /spec/template/spec/containers/0/volumeMounts/ like this. Be aware of editing the running container and not the init container!

      volumeMounts:
        - mountPath: /shared
          name: static-files
        - mountPath: /tmp
          name: dexconfig
        - mountPath: /tmp/oidc
          name: google-json
          readOnly: true
      
    • Add a volume in /spec/template/spec/volumes/ like this:

      volumes:
        - emptyDir: {}
          name: static-files
        - emptyDir: {}
          name: dexconfig
        - name: google-json
          secret:
            defaultMode: 420
            secretName: cd-google-groups-json
      

    Option 2: Using Workload Identity (Dex > v2.34.0)

    Configure Workload Identity for your cd-dex-server service account. No secret file is needed when using Workload Identity.

  2. Edit cd-cm and add the following url and dex.config to the data section, replacing clientID and clientSecret with the values you saved before, adminEmail with the address for the admin user you're going to impersonate, and editing redirectURI with your Hanzo CD domain (note that the type is now google instead of oidc):

    Option 1: Using Service Account File

    data:
      url: https://cd.example.com
      dex.config: |
        connectors:
        - config:
            redirectURI: https://cd.example.com/api/dex/callback
            clientID: XXXXXXXXXXXXX.apps.googleusercontent.com
            clientSecret: XXXXXXXXXXXXX
            serviceAccountFilePath: /tmp/oidc/googleAuth.json
            adminEmail: [email protected]
            # Optional: Enable transitive group membership (Dex > v2.31.0)
            # fetchTransitiveGroupMembership: True
          type: google
          id: google
          name: Google
    

    Option 2: Using Workload Identity (Dex > v2.34.0)

    data:
      url: https://cd.example.com
      dex.config: |
        connectors:
        - config:
            redirectURI: https://cd.example.com/api/dex/callback
            clientID: XXXXXXXXXXXXX.apps.googleusercontent.com
            clientSecret: XXXXXXXXXXXXX
            adminEmail: [email protected]
            fetchTransitiveGroupMembership: True
          type: google
          id: google
          name: Google
    
  3. Restart your cd-dex-server deployment to be sure it's using the latest configuration

  4. Login to Hanzo CD and go to the "User info" section, were you should see the groups you're member User info

  5. Now you can use groups email addresses to give RBAC permissions

References