Skip to main content
Version: 1.47

Use Google as your Authentication Provider

This guide will walk you through the steps necessary to configure Google as the authentication provider for Okteto.

Google's documentation explains how to create an OAuth 2.0 Client.

Prerequisites​

  • A working installation of Okteto
  • Helm 3.0+ installed on your local machine
  • Access to a Google account with permissions to create an OAuth 2.0 Client

Create the OAuth 2.0 Client​

When you create the OAuth 2.0 Client, provide the following values:

Authorized javascript origin:

https://okteto.DOMAIN

Authorized redirect URIs:

https://okteto.DOMAIN
https://okteto.DOMAIN/auth/callback

Copy the Client ID and Client Secret values. You need them to configure Okteto.

Configure Okteto​

When the Google OAuth 2.0 Client is ready, update the auth section of your Helm configuration file with the following values:

config.yaml
auth:
google:
enabled: true
clientId: "REPLACE_ME_WITH_YOUR_OAUTH_CLIENT_ID"
clientSecret: "REPLACE_ME_WITH_YOUR_OAUTH_CLIENT_SECRET"
allowDomains:
- example.com

You can also store the sensitive part of these credentials in a Kubernetes secret.

Upgrade your Okteto instance to apply the new configuration. Upgrade to the same version you already run: it keeps the changes to a minimum and makes any issue easier to troubleshoot.

The allowDomains field is optional. When you set it, only users whose Google Workspace accounts match one of the listed domains can log in to your Okteto instance. An empty allowDomains field lets any user with a valid Google Workspace account log in.