OAuth Setup
Configure Google login for your self-hosted instance.
answerLoops signs your team in with Google. This page walks you through creating a Google OAuth client, which is a set of credentials that lets answerLoops ask Google who is signing in. When you are done, the sign-in page shows a Google button.
Google is the only sign-in method. Discord, Slack, and GitHub connections inside the product are for linking channels, and you set those up after you are signed in.
The sign-in page only offers a method whose credentials are set. Without the two variables below it shows a notice that sign-in is not set up, instead of a button.
Create the Google client
Open console.cloud.google.com, then go to APIs & Services → Credentials.
Select Create Credentials → OAuth client ID.
Set the application type to Web application.
Add this authorized redirect URI, using your own address in place of the example:
- Local:
http://localhost:3000/api/auth/callback/google - Production:
https://<your-domain>/api/auth/callback/google
Copy the Client ID and Client secret, and add them to .env:
AUTH_GOOGLE_ID=<your-google-client-id>
AUTH_GOOGLE_SECRET=<your-google-client-secret>Restart the app after changing .env.
How sign-in works
The callback address in the fifth message is built from AUTH_URL, so that variable must match the public address you actually use.
The redirect URI in Google must match your address exactly. A trailing slash, http versus https, or a different port each count as a mismatch. If Google shows a redirect_uri_mismatch error, see troubleshooting.