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.
- Make sure to set the Authorized redirect URIs to:
Configuration
-
Configure authentication by editing the
spec.dex.config
section of the/var/lib/rancher/k3s/server/manifests/axoflow.yaml
file.-
(Optional) If you’ve used our earlier example, delete the
spec.dex.config.staticPasswords
section. -
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>
-
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.
-
-
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.
NoteThe email addresses of your users must have the same domain as the one set under `connectors.config.hostedDomains`, otherwise the authorization will fail.
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.
- List the email addresses of the users who have read and write access to Axoflow Console under the
-
Save the file.
-
Restart the dex deployment after changing the connector:
kubectl rollout restart deployment/dex -n axoflow
Expected output:
deployment.apps/dex restarted
-
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.