Google Auth (Pro)

DefectDojo Pro supports login via Google accounts over OAuth 2.0. New users are created automatically on first login if they don’t already exist, and existing DefectDojo users are matched to Google accounts by username (the portion before the @ in their Google email). Open-source DefectDojo does not include SSO — see Authorized Users for open-source access control.

Callback URL

Google needs the exact redirect URI DefectDojo listens on after a user authenticates. It is your DefectDojo base URL followed by /complete/google-oauth2/:

https://<your-instance>.cloud.defectdojo.com/complete/google-oauth2/

On-premise, replace the host with your own DefectDojo base URL, keeping the /complete/google-oauth2/ path. Register it under Authorized redirect URIs on the OAuth client.

Prerequisites

Complete the following steps in the Google Cloud Console before configuring DefectDojo:

  1. Sign in to the Google Cloud Console and select or create a project.

  2. Go to APIs & Services > Credentials > Create Credentials > OAuth client ID.

  3. Select Web application as the application type and give it a descriptive name (e.g. DefectDojo).

  4. Under Authorized redirect URIs, add the Callback URL above.

  5. Create the client and note the Client ID and Client secret.

Configuration

In DefectDojo, go to Connect > Authorization > Providers, select Google, and fill in the form:

  • Google OAuth Key: enter your Client ID.
  • Google OAuth Secret: enter your Client secret. After you save it, the secret is never shown again. Leave the field blank to keep it, and enter it again only if you change the client ID.
  • Whitelisted Domains: enter one or more email-address domains (e.g. yourcompany.com) allowed to sign in, separated by commas. Spaces after the commas are ignored. Enter each domain on its own, without @, https:// or a wildcard such as *.yourcompany.com: the form refuses an entry that could never match an address.
  • Whitelisted Email Addresses: alternatively, enter specific addresses allowed to sign in (e.g. user1@yourcompany.com, user2@yourcompany.com), separated by commas.
  • Require Verified Email to Link Accounts: on by default. A sign-in is linked to an existing DefectDojo account with the same email only when the provider marks that email verified (email_verified). Turn it off only if the provider verifies every email it sends. See Linking a sign-in to an existing account.

Set at least one whitelisted domain or email address: the form refuses to enable Google OAuth with both lists empty. Google authenticates any account, and DefectDojo signs in only an address on one of the lists.

If Google OAuth was already enabled with both lists empty before this check arrived, any Google account can still sign in. Open the form, add a domain or address, and save to restrict it.

Check Enable Google OAuth and submit the form. A Login With Google button will appear on the login page. Clearing Enable Google OAuth turns Google sign-in off completely: the button goes away, and a bookmarked or direct link to the Google sign-in no longer works.

Use Validate Config at any point to check the settings without saving them. It confirms the settings are complete, fetches the Google discovery document, checks the whitelist entries the same way saving does, and echoes the exact redirect URI to register at Google.

First login and default access

A user provisioned without any group membership lands with no permissions. To give every new SSO user a baseline, set a Default group and Default group role on the System Settings page — see Default access for SSO-provisioned users. Google login does not synchronize Google Workspace groups into DefectDojo groups.

Troubleshooting

“Your identity provider did not confirm your email address” on the login page. The sign-in matches an existing account by email, but the provider did not send email_verified=true. See Linking a sign-in to an existing account.

Everyone is rejected even though the Google prompt succeeds. No whitelist is set, or the address is not on it. Add the user’s domain to Whitelisted Domains or their address to Whitelisted Email Addresses, comma-separated with no spaces.

Login fails immediately after the Google prompt. A redirect-URI mismatch — confirm Authorized redirect URIs contains the exact Callback URL.

Start with Diagnostics. Rejected sign-ins are recorded under Connect > Diagnostics with the reason each was refused.