Google Auth
On this page
Open-Source DefectDojo supports login via Google accounts. New users are created automatically on first login if they don’t already exist. Existing DefectDojo users are matched to Google accounts by username (the portion before the @ in their Google email). DefectDojo Pro users should refer to the Pro Google guide.
Prerequisites
Complete the following steps in the Google Cloud Console before configuring DefectDojo:
Sign in to the Google Developers Console.
Go to Credentials > Create Credentials > OAuth Client ID.
Select Web Application and give it a descriptive name (e.g.
DefectDojo).Under Authorized Redirect URIs, add:
https://your-dojo-host/complete/google-oauth2/Note the Client ID and Client Secret Key.
Configuration
Set the following as environment variables, or without the DD_ prefix in your local_settings.py file (see Configuration):
DD_SOCIAL_AUTH_GOOGLE_OAUTH2_ENABLED=True,
DD_SOCIAL_AUTH_GOOGLE_OAUTH2_KEY=(str, 'YOUR_CLIENT_ID'),
DD_SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET=(str, 'YOUR_CLIENT_SECRET'),You must also authorize which users can log in. You can whitelist by domain:
DD_SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS=['example.com', 'example.org']Or as an environment variable (comma-separated):
DD_SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS=example.com,example.orgAlternatively, whitelist specific email addresses:
DD_SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_EMAILS=['user@example.com']Or as an environment variable:
DD_SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_EMAILS=user@example.com,user2@example.comRestart DefectDojo. A Login With Google button will appear on the login page.