This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Google

This section shows you how to use Google OpenID Connect as an authentication backend for Axoflow Console. It is assumed that you already have a Google organization and Google Cloud Console access. Complete the following steps.

Prerequisites

  • To use Google authentication, Axoflow Console must be deployed on a publicly accessible domain name (the $BASE_HOSTNAME must end with a valid top-level domain, for example, .com or .io.)

  • Configure OpenID Connect and create an OpenID credential for a Web application.

    • Make sure to set the Authorized redirect URIs to: https://auth.<your-console-host.your-domain>/callback, for example, https://auth.axoflow-console.example.com/callback.
    • Save the Client ID of the app and the Client secret of the application, you’ll need them to configure Axoflow Console.

    For details on setting up OpenID Connect, see the official documentation.

Configuration

  1. Configure authentication by editing the spec.dex.config section of the /var/lib/rancher/k3s/server/manifests/axoflow.yaml file.

    1. (Optional) If you’ve used our earlier example, delete the spec.dex.config.staticPasswords section.

    2. Add the spec.dex.config.connectors section to the file, like this:

      connectors:
      - type: google
        id: google
        name: Google
        config:
          # Connector config values starting with a "$" will read from the environment.
          clientID: <ID-of-Google-application>
          clientSecret: <Secret-of-GitHub-application>
      
          # Dex's issuer URL + "/callback"
          redirectURI: <idp.your-host.your-domain/callback>
      
          # Set the value of `prompt` query parameter in the authorization request
          # The default value is "consent" when not set.
          promptType: consent
      
          # Google supports whitelisting allowed domains when using G Suite
          # (Google Apps). The following field can be set to a list of domains
          # that can log in:
          #
          hostedDomains:
          - <your-domain>
      
    3. Edit the following fields. For details on the configuration parameters, see the Dex Google connector documentation.

      • connectors.config.clientID: The ID of the Google application.
      • connectors.config.clientSecret: The client secret of the Google application.
      • connectors.config.redirectURI: The callback URL of the Google application: https://auth.<your-console-host.your-domain>/callback, for example, https://auth.axoflow-console.example.com/callback.
      • connectors.config.hostedDomains: The domain where Axoflow Console is deployed, for example, example.com. Your users must have email addresses for this domain at Google.
  2. Configure authorization in the spec.pomerium.policy section of the /var/lib/rancher/k3s/server/manifests/axoflow.yaml file.

    • List the email addresses of the users who have read and write access to Axoflow Console under the emails section.
    • List the email addresses of the users who have read-only access to Axoflow Console under the readOnly.emails section.
      policy:
        emails:
          - username@yourdomain.com
        domains: []
        groups: []
        claim/groups: []
        readOnly:
          emails:
            - readonly-username@yourdomain.com
          domains: []
          groups: []
          claim/groups: []
    

    For details on authorization settings, see Authorization.

  3. Save the file.

  4. Restart the dex deployment after changing the connector:

    kubectl rollout restart deployment/dex -n axoflow
    

    Expected output:

    deployment.apps/dex restarted
    
  5. Open the main page of your Axoflow Console deployment in your browser. You’ll be redirected to the Google authentication page.

    After completing the Google authentication you can access Axoflow Console.

Getting help

You can troubleshoot common errors by running kubectl logs -n axoflow <dex-container-name>

If you run into problems setting up the authentication or authorization, contact us.