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 URLneeds to be the url of your PostHog instanceAutherization callback URLneeds to be the url of your PostHog instance +/complete/github/
- Find your
Client IDandClient Secret - Add those two settings as
SOCIAL_AUTH_GITHUB_KEYandSOCIAL_AUTH_GITHUB_SECRETand 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 -> applicationsin 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_useras scope.
- Redirect URI needs to be the url of your PostHog instance +
- Find your
Application IDandSecret - Add those two settings as
SOCIAL_AUTH_GITLAB_KEYandSOCIAL_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.