GitHub SSO
Learn how to configure GitHub SSO for Hanzo KMS.
Using GitHub SSO on a self-hosted instance of Hanzo KMS requires configuring an OAuth2 application in GitHub and registering your instance with it.
Navigate to your user Settings > Developer settings > OAuth Apps to create a new GitHub OAuth application.

Create the OAuth application. As part of the form, set the Homepage URL to your self-hosted domain https://your-domain.com
and the Authorization callback URL to https://your-domain.com/api/v1/sso/github.

If you have a GitHub organization, you can create an OAuth application under it in your organization Settings > Developer settings > OAuth Apps > New Org OAuth App.
Obtain the Client ID and generate a new Client Secret for your GitHub OAuth application.

Back in your Hanzo KMS instance, make sure to set the following environment variables:
CLIENT_ID_GITHUB_LOGIN: The Client ID of your GitHub OAuth application.CLIENT_SECRET_GITHUB_LOGIN: The Client Secret of your GitHub OAuth application.AUTH_SECRET: A secret key used for signing and verifying JWT. This can be a random 32-byte base64 string generated withopenssl rand -base64 32.SITE_URL: The URL of your self-hosted instance of Hanzo KMS - should be an absolute URL including the protocol (e.g. https://app.kms.hanzo.ai)
Once added, restart your Hanzo KMS instance and log in with GitHub.
FAQ
It is likely that you have misconfigured your self-hosted instance of Hanzo KMS. You should:
- Check that you have set the
CLIENT_ID_GITHUB_LOGIN,CLIENT_SECRET_GITHUB_LOGIN,AUTH_SECRET, andSITE_URLenvironment variables. - Check that the Authorization callback URL specified in GitHub matches the
SITE_URLenvironment variable. For example, if the former ishttps://app.kms.hanzo.ai/api/v1/sso/githubthen the latter should behttps://app.kms.hanzo.ai.
How is this guide?
Last updated on