Login with GitHub or GitLab
If you want to make it really easy for your users to log in, you can add one-click login with GitHub or GitLab.
GitHub
If you want to have this application as part of an organisation, you'll need to go to your organization's settings -> OAuth apps -> New OAuth App.
-
Register your application
Homepage URL
needs to be the url of your PostHog instanceAutherization callback URL
needs to be the url of your PostHog instance +/complete/github/
- Find your
Client ID
andClient Secret
- Add those two settings as
SOCIAL_AUTH_GITHUB_KEY
andSOCIAL_AUTH_GITHUB_SECRET
and restart your server. - When logging in, or signing up to a team you can now log in using PostHog!
We don't support logging in with GitHub when setting up PostHog for the very first time.
GitLab
- Go to
settings -> applications
in your GitLab instance (click here for GitLab.com) -
Register your application
- Redirect URI needs to be the url of your PostHog instance +
/complete/github/
- Tick
read_user
as scope.
- Redirect URI needs to be the url of your PostHog instance +
- Find your
Application ID
andSecret
- Add those two settings as
SOCIAL_AUTH_GITLAB_KEY
andSOCIAL_AUTH_GITHUB_SECRET
. If you're hosting GitLab yourself you'll also need to addSOCIAL_AUTH_GITLAB_API_URL
, which is the full URL to your GitLab instance.
We don't support logging in with GitLab when setting up PostHog for the very first time.