From 46dbb7594b4bd0e47c8385f02f0cd72e5fa5e46b Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Sun, 16 Jul 2023 22:33:53 +0200 Subject: [PATCH] update Google auth setup instructions Update based on my experience going through them. --- .../docs/configuration/authorization/index.md | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/site/src/docs/configuration/authorization/index.md b/site/src/docs/configuration/authorization/index.md index d1cc624c24..b862b7c2d8 100644 --- a/site/src/docs/configuration/authorization/index.md +++ b/site/src/docs/configuration/authorization/index.md @@ -4,7 +4,7 @@ title: Authorization ## OAuth Providers -Authentication handled by external providers. You should set up OAuth2 for at least one of them to allow users to make comments. It is not mandatory to have all of them, but one should be correctly configured. +Authentication is handled by external providers. You should set up OAuth2 for at least one to allow users to comment. It is not mandatory to have all of them, but one should be correctly configured. ### Apple @@ -12,11 +12,11 @@ Authentication handled by external providers. You should set up OAuth2 for at le 1. If you don't have an App ID yet, [create one](https://developer.apple.com/account/resources/identifiers/add/bundleId). Later on, you'll need **TeamID**, which is an "App ID Prefix" value. 1. Enable the "Sign in with Apple" capability for your App ID in [the Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources/identifiers/list) section. 1. Create [Service ID](https://developer.apple.com/account/resources/identifiers/list/serviceId) and bind with App ID from the previous step. Apple will display the description field value to end-users on sign-in. You'll need that service **Identifier as a ClientID** later on. -1. Configure "Sign in with Apple" for created Service ID. Add domain where you will use that auth on to "Domains and subdomains" and its main page URL (like `https://example.com/` to "Return URLs". -1. Register a [New Key](https://developer.apple.com/account/resources/authkeys/list) (**private key**) for the "Sign in with Apple" feature and download it, you'll need to put it to `/srv/var/apple.p8` path inside container. Also write down the private **Key ID**. +1. Configure "Sign in with Apple" for created Service ID. Add the domain where you will use that auth to "Domains and subdomains" and its main page URL (like `https://example.com/` to "Return URLs". +1. Register a [New Key](https://developer.apple.com/account/resources/authkeys/list) (**private key**) for the "Sign in with Apple" feature and download it, you'll need to put it to `/srv/var/apple.p8` path inside the container. Also, write down the private **Key ID**. 1. Add your Remark42 domain name and sender email in the Certificates, Identifiers & Profiles >> [More](https://developer.apple.com/account/resources/services/configure) section as a new Email Source. -After completing the previous steps, you can proceed with configuring the Apple auth provider. You'll need to set the following environment variables: +After completing the previous steps, you can configure the Apple auth provider. You'll need to set the following environment variables: - `AUTH_APPLE_CID` (**required**) - Client ID - `AUTH_APPLE_TID` (**required**) - Team ID @@ -29,7 +29,7 @@ After completing the previous steps, you can proceed with configuring the Apple 2. Create a new app with [this manual](https://developers.facebook.com/docs/development/create-an-app/) or use an existing app 3. Open your app and choose **"Facebook Login"** and then **"Web"** 4. Set **"Site URL"** to your domain, e.g., `https://remark42.mysite.com` -5. Under **"Facebook login"**/**"Settings"** fill "Valid OAuth redirect URIs" with your callback URL constructed as domain plus `/auth/facebook/callback`, e.g `https://remark42.mysite.com/auth/facebook/callback` +5. Under **"Facebook login"**/**"Settings"** fill in "Valid OAuth redirect URIs" with your callback URL constructed as domain plus `/auth/facebook/callback`, e.g. `https://remark42.mysite.com/auth/facebook/callback` 6. Select **"App Review"** and turn the public flag on. This step may ask you to provide a link to your privacy policy 7. Write down the client ID and secret as `AUTH_FACEBOOK_CID` and `AUTH_FACEBOOK_CSEC` @@ -46,16 +46,30 @@ After completing the previous steps, you can proceed with configuring the Apple 2. Choose the new project from the top right project dropdown (only if another project is selected) 3. In the project Dashboard center pane, choose **"APIs & Services"** 4. In the left Nav pane, choose **"Credentials"** -5. In the center pane, choose the **"OAuth consent screen"** tab. Fill in **"Product name shown to users"** and hit save +5. In the center pane, choose the **"OAuth consent screen"** tab. + + - Select "**External**" and click "Create" + - Fill in **"App name"** and select **User support email** + - Upload a logo, if you want to + - In the **App Domain** section: + - **Application home page** - your site URL, e.g., `https://mysite.com` + - **Application privacy policy link** - `/web/privacy.html` of your Remark42 installation, e.g. `https://remark42.mysite.com/web/privacy.html` (please check that it works) + - **Terms of service** - leave empty + - **Authorized domains** - your site domain, e.g., `mysite.com` + - **Developer contact information** - add your email, and then click **Save and continue** + - On the **Scopes** tab, just click **Save and continue** + - On the **Test users**, add your email, then click **Save and continue** + - Before going to the next step, set the app to "Production" and send it to verification + 6. In the center pane, choose the **"Credentials"** tab - - Open the **"Create credentials"** drop-down - - Choose **"OAuth client ID"** - - Choose **"Web application"** - - Application name is freeform; choose something appropriate - - Authorized origins should be your domain, e.g., `https://remark42.mysite.com` - - Authorized redirect URIs is the location of OAuth2/callback constructed as domain + `/auth/google/callback`, e.g., `https://remark42.mysite.com/auth/google/callback` - - Choose **"Create"** + - Open the **"Create credentials"** drop-down + - Choose **"OAuth client ID"** + - Choose **"Web application"** + - Application **Name** is freeform; choose something appropriate, like "Comments on mysite.com" + - **Authorized JavaScript Origins** should be your domain, e.g., `https://remark42.mysite.com` + - **Authorized redirect URIs** is the location of OAuth2/callback constructed as domain + `/auth/google/callback`, e.g., `https://remark42.mysite.com/auth/google/callback` + - Click **"Create"** 7. Take note of the **Client ID** (`AUTH_GOOGLE_CID`) and **Client Secret** (`AUTH_GOOGLE_CSEC`)