From f74265850b9ed22eb94d41faa68ba35ed9ec3b75 Mon Sep 17 00:00:00 2001 From: Jacob Flaherty <98563031+sjacobflaherty@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:58:27 -0700 Subject: [PATCH] chore: Update .env.example commenting (#1257) Adds documentation on how to setup Google for OAuth when self hosting Documenso. --- .env.example | 2 ++ .../pages/developers/self-hosting/_meta.json | 5 ++-- .../setting-up-oauth-providers.mdx | 29 +++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 apps/documentation/pages/developers/self-hosting/setting-up-oauth-providers.mdx diff --git a/.env.example b/.env.example index bba951b86..ed77d048a 100644 --- a/.env.example +++ b/.env.example @@ -10,6 +10,8 @@ NEXT_PRIVATE_ENCRYPTION_KEY="CAFEBABE" NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY="DEADBEEF" # [[AUTH OPTIONAL]] +# Find documentation on setting up Google OAuth here: +# https://docs.documenso.com/developers/self-hosting/setting-up-oauth-providers#google-oauth-gmail NEXT_PRIVATE_GOOGLE_CLIENT_ID="" NEXT_PRIVATE_GOOGLE_CLIENT_SECRET="" diff --git a/apps/documentation/pages/developers/self-hosting/_meta.json b/apps/documentation/pages/developers/self-hosting/_meta.json index b0d771a3e..5f40bbbc2 100644 --- a/apps/documentation/pages/developers/self-hosting/_meta.json +++ b/apps/documentation/pages/developers/self-hosting/_meta.json @@ -1,5 +1,6 @@ { "index": "Getting Started", "signing-certificate": "Signing Certificate", - "how-to": "How To" -} + "how-to": "How To", + "setting-up-oauth-providers": "Setting up OAuth Providers" +} \ No newline at end of file diff --git a/apps/documentation/pages/developers/self-hosting/setting-up-oauth-providers.mdx b/apps/documentation/pages/developers/self-hosting/setting-up-oauth-providers.mdx new file mode 100644 index 000000000..0ba359142 --- /dev/null +++ b/apps/documentation/pages/developers/self-hosting/setting-up-oauth-providers.mdx @@ -0,0 +1,29 @@ +--- +title: Setting up OAuth Providers +description: Learn how to set up OAuth providers for your own instance of Documenso. +--- + +## Google OAuth (Gmail) + +To use Google OAuth, you will need to create a Google Cloud Platform project and enable the Google Identity and Access Management (IAM) API. You will also need to create a new OAuth client ID and download the client secret. + +### Create and configure a new OAuth client ID + +1. Go to the [Google Cloud Platform Console](https://console.cloud.google.com/) +2. From the projects list, select a project or create a new one +3. If the APIs & services page isn't already open, open the console left side menu and select APIs & services +4. On the left, click Credentials +5. Click New Credentials, then select OAuth client ID +6. When prompted to select an application type, select Web application +7. Enter a name for your client ID, and click Create +8. Click the download button to download the client secret +9. Set the authorized javascript origins to `https://` +10. Set the authorized redirect URIs to `https:///api/auth/callback/google` +11. In the Documenso environment variables, set the following: + +``` +NEXT_PRIVATE_GOOGLE_CLIENT_ID= +NEXT_PRIVATE_GOOGLE_CLIENT_SECRET= +``` + +Finally verify the signing in with Google works by signing in with your Google account and checking the email address in your profile.