T
Twentyβ€’3w ago
Sebastian

Google OAuth doesn't work in Docker Compose

Running Twenty in Docker Compose yet I can't get Google OAuth to work. Following env vars are set in .env file:
AUTH_GOOGLE_ENABLED=true
AUTH_GOOGLE_CLIENT_ID=xxx
AUTH_GOOGLE_CLIENT_SECRET=xxx
AUTH_GOOGLE_CALLBACK_URL=https://crm.domain.com/auth/google/redirect
AUTH_GOOGLE_APIS_CALLBACK_URL=https://crm.domain.com/auth/google-apis/get-access-token
AUTH_GOOGLE_ENABLED=true
AUTH_GOOGLE_CLIENT_ID=xxx
AUTH_GOOGLE_CLIENT_SECRET=xxx
AUTH_GOOGLE_CALLBACK_URL=https://crm.domain.com/auth/google/redirect
AUTH_GOOGLE_APIS_CALLBACK_URL=https://crm.domain.com/auth/google-apis/get-access-token
15 Replies
charles
charlesβ€’3w ago
what do you mean by it does not work? πŸ™‚
Sebastian
SebastianOPβ€’3w ago
when I open the main URL I can't see any SSO button to log in, just to enter the email, which is local basic auth
charles
charlesβ€’3w ago
could you check your /graphql ClientConfig call in your network tab?
charles
charlesβ€’3w ago
No description
charles
charlesβ€’3w ago
let's make sure you have google: true if not, could you ssh in your container and make sure your env variables are set? (run "env" in your ssh terminal)
Sebastian
SebastianOPβ€’3w ago
thx, I'll check it tomorrow and will get back to you
charles
charlesβ€’3w ago
sure πŸ™‚
Sebastian
SebastianOPβ€’3w ago
I think I've found the issue. I've added the env vars to .env file, but didn't add them to docker-compose.yml πŸ€¦β€β™‚οΈ let's see if that fixes the issue yep, that was the issue, it works fine now πŸ™‚ however, I'm not sure about the AUTH_GOOGLE_APIS_CALLBACK_URL there's nothing in docs what should it be, and it looks like google account connection doesn't work, when I want to connect google account to emails error I'm getting:
You cannot sign in to this application because it does not comply with Google's OAuth 2.0 policy.

If you are the one who developed the application, record the redirect URI in the Google Cloud Console.
Request details: redirect_uri=https://crm.domain.com/auth/google-apis/get-access-token flowName=GeneralOAuthFlow
You cannot sign in to this application because it does not comply with Google's OAuth 2.0 policy.

If you are the one who developed the application, record the redirect URI in the Google Cloud Console.
Request details: redirect_uri=https://crm.domain.com/auth/google-apis/get-access-token flowName=GeneralOAuthFlow
Sebastian
SebastianOPβ€’3w ago
No description
Sebastian
SebastianOPβ€’3w ago
@charles is it the right callback uri? also what Authorised redirect URIs should be in GCP Credentials? also nothing about that in the docs
Sebastian
SebastianOPβ€’3w ago
I've just added both URIs to GCP and it looks like it works now. please update the docs, so others wouldn't need to look into https://github.com/twentyhq/twenty/blob/c17e18b1e928eac02afaee12ff04cbf51f48e712/packages/twenty-server/.env.example to find out URIs πŸ™‚
GitHub
twenty/packages/twenty-server/.env.example at c17e18b1e928eac02afae...
Building a modern alternative to Salesforce, powered by the community. - twentyhq/twenty
charles
charlesβ€’3w ago
good point! any chance you or anybody else could open a PR on twenty to add the example values to the doc?
Sebastian
SebastianOPβ€’3w ago
I'll do that, but a bit later today
charles
charlesβ€’3w ago
ty ❀️
Want results from more Discord servers?
Add your server