Use GitHub as your Authentication Provider
This guide will walk you through the steps necessary to configure GitHub as the authentication provider for Okteto.
GitHub's documentation explains how to create an OAuth App.
Prerequisites
- A working installation of Okteto
- Helm 3.0+ installed on your local machine
- Access to a GitHub account with permissions to create an OAuth App
If you plan to use the Okteto GitHub Integration to access private repositories, configure the Okteto GitHub App first. You then use that same GitHub App for both the integration and the OAuth login.
Create the OAuth App
When you create the OAuth App, provide the following values:
Homepage URL:
https://okteto.DOMAIN
Authorization callback URL:
https://okteto.DOMAIN/auth/callback
Copy the Cliend ID and Client Secret values. You'll need them to configure Okteto.
Configure Okteto
When the GitHub OAuth App is ready, update the auth section of your Helm configuration file with the following values:
auth:
github:
enabled: true
clientId: "REPLACE_ME_WITH_YOUR_OAUTH_APP_CLIEND_ID"
clientSecret: "REPLACE_ME_WITH_YOUR_OAUTH_APP_CLIEND_SECRET"
organization: "REPLACE_ME_WITH_YOUR_GITHUB_ORGANIZATION"
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 organization field is optional. Only members of the organization will be allowed to log in into your Okteto instance. An empty organization field permits any user to log in.
If your Okteto instance is publicly reachable, set up access restrictions. An empty organization field lets anyone with a GitHub account log in to your Okteto instance.
To give access to users outside your GitHub organization, list their GitHub accounts in the allowList key.
auth:
github:
enabled: true
clientId: "REPLACE_ME_WITH_YOUR_OAUTH_APP_CLIEND_ID"
clientSecret: "REPLACE_ME_WITH_YOUR_OAUTH_APP_CLIEND_SECRET"
organization: "REPLACE_ME_WITH_YOUR_GITHUB_ORGANIZATION"
allowList: ["acct1","acct2","acct3"]