From 841cbff2494f43ab406c32ac75d19845bfed8f4a Mon Sep 17 00:00:00 2001 From: sabaimran Date: Sat, 1 Jun 2024 21:38:21 +0530 Subject: [PATCH] Add documentation for setting up google auth in self-hosted khoj. Closes #771 --- documentation/docs/miscellaneous/google_auth.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 documentation/docs/miscellaneous/google_auth.md diff --git a/documentation/docs/miscellaneous/google_auth.md b/documentation/docs/miscellaneous/google_auth.md new file mode 100644 index 00000000..bdba9d7e --- /dev/null +++ b/documentation/docs/miscellaneous/google_auth.md @@ -0,0 +1,17 @@ +# Setting up Google Auth + +To set up your self-hosted Khoj with Google Auth, you need to create a project in the Google Cloud Console and enable the Google Auth API. + + +To implement this, you'll need to: +1. You must use the `python` package or build from source, because you'll need to install additional packages for the google auth libraries (`prod`). The syntax to install the right packages is +``` +pip install khoj-assistant[prod] +``` +2. [Create authorization credentials](https://developers.google.com/identity/sign-in/web/sign-in) for your application. +3. Go to your [Google cloud console](https://console.developers.google.com/apis/credentials) and create a configuration like below for the relevant `OAuth 2.0 Client IDs` project: +![Google auth login project settings](https://github.com/khoj-ai/khoj/assets/65192171/9bcbf6f4-197d-4d0c-973a-c10b1331c892) + +4. Configure these environment variables: `GOOGLE_CLIENT_SECRET`, and `GOOGLE_CLIENT_ID`. You can find these values in the Google cloud console, in the same place where you configured the authorized origins and redirect URIs. + +That's it! That should be all you have to do. Now, when you reload Khoj without `--anonymous-mode`, you should be able to use your Google account to sign in.