defguard
  • Introduction
  • User documentation (help)
    • Configuring VPN
      • Defguard Desktop Client
        • Update instance
      • Other WireGuard® Clients
        • Configuring a device for new VPN Location manually
    • Password change / Reset
    • Enrollment & Onboarding
      • With internal Defguard SSO
      • With external SSO (Google/Microsoft/Custom)
    • Setting up 2FA/MFA
    • Desktop Client
    • CLI Client
  • Admin & features
    • Deploying your instance
      • One-line install script
      • Standalone package based installation
      • Docker images and tags
      • Docker Compose
      • Kubernetes
      • Upgrading
      • Gateway
        • Running gateway on MikroTik routers
      • Securing gRPC communication
      • OpenID RSA key
      • Configuration
      • Pre-production and development releases
      • High Availability and Failover
      • Health check
    • Features & configuration
      • Zero-Trust VPN with 2FA/MFA
        • Create/manage VPN Location
        • Network overview
        • Executing custom gateway commands
        • Multi-Factor Authentication (MFA/2FA)
          • MFA Architecture
        • Remote desktop client configuration
        • DNS and domains
      • Remote user enrollment
        • User onboarding after enrollment
      • SSO (OpenID Connect)
        • Portainer
        • Grafana setup
        • Proxmox
        • Matrix / Synapse
        • Django
        • MinIO
        • Vault
      • SMTP for email notifications
      • YubiKey Provisioning
      • Webhooks
      • Forward auth
      • SSH Authentication
      • Network devices
      • Gateway notifications
      • New version notifications
  • Troubleshooting Guide
    • Sending support information
    • Client Windows installer exit codes
    • Client "All traffic" connection issues
    • WebAuthn security keys
  • Enterprise Features
    • License
    • Enteprise features
      • Automatic (real time) desktop client configuration & sync
      • External OpenID providers
        • Google
        • Microsoft
        • Zitadel
        • Keycloak
        • JumpCloud
        • Okta
        • Custom
      • External OIDC secure enrollment
      • VPN & Client behavior customization
      • REST API
      • Access Control List
        • ACL Aliases
      • LDAP and Active Directory integration
        • Configuration
        • Settings table
        • Two-way LDAP and Active Directory synchronization
  • Tutorials
    • Step by step setting up a VPN server
      • Adding additional VPN locations
  • In depth
    • Roadmap
    • Architecture
      • How do VPN statistics work
      • Security concepts
  • For Developers
    • Contributing
    • Environment setup
    • Translations (core/web)
      • Switching language
      • Adding translations
  • Translations (client)
    • Adding translations
  • Contact us
    • Community & Support
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Enterprise Features
  2. Enteprise features
  3. External OpenID providers

Google

PreviousExternal OpenID providersNextMicrosoft

Last updated 2 months ago

Was this helpful?

Here is about this process.

  1. The Google OpenID Connect can be configured in the

  2. If you don't have any project setup already (or you want to create a new one for this purpose), create it by clicking the dropdown menu here:

    If you already have project, make sure to select it in the above dropdown menu.

  3. Now, navigate to

  4. We will focus on the consent screen first, select OAuth consent screen

  5. Pick the User Type according to your needs, this example will focus on the internal type

  6. Fill in all required details. Make sure to fill the correct domain. This should be the top domain under which your Defguard dashboard can be accessed, not the subdomain (e.g. defguard.example.com -> example.com).

  7. On the scopes config screen, click ADD OR REMOVE SCOPES, Defguard requires at least the following scopes:

  8. Proceed until the end and return to the OAuth consent screen dashboard.

  9. Now, go to , click CREATE CREDENTIALS and choose OAuth client ID

  10. On the next screen, fill out all required information:

    Make sure to select "Web application" as the application type. The other thing to note here is the redirect URI. It is the URI to which the user will be redirected from the external provider's authorization. This URI is in the form of <DEFGUARD_DASHBOARD_URL>/auth/callback. Replace <DEFGUARD_DASHBOARD_URL> with the URL under which your dashboard is accessible, e.g. https://defguard.example.com. If you'd like to use OpenID enrollment through proxy, make sure to enter an additional URI here in the form of <DEFGUARD_ENROLLMENT_URL>/openid/callback.

  11. After you proceed further, you will be presented with a popup containing your Client ID and Client Secret, copy them and paste on the Defguard OpenID configuration page.

Directory synchronization

This feature is currently technically limited to 10000 members or groups. High user or group counts may still trigger your provider API limits even below this threshold. If you have many users (200+), we recommend you test this feature first before you decide to turn on automatic user deletion.

This feature is available only in Defguard v1.2.0 and above

Directory synchronization configuration menu

The menu can be found in Defguard settings by navigating to the "OpenID" tab.

The following configuration options are currently available in the directory synchronization menu specifically for the Google provider:

  • Admin email: The email of the Google Workspace admin user on whose behalf Defguard will call the Google API

  • Service account in use: The email of the Google service account that is currently used

Directory synchronization setup

  1. Click "Create service account"

  2. Give your service account a descriptive name

  3. Skip step 2 and 3 if you are not sure what to configure there.

  4. Go to your newly created service account and add a new key in the "KEYS" tab.

  5. A JSON file will be downloaded after you click "CREATE". Store it securely as it may grant access to your Google Workspace directory.

  6. Next, navigate to the "DETAILS" tab and copy the unique ID of your service account.

  7. Open the Advanced settings and under Domain-wide delegation click "View google workspace admin console"

  8. In the API controls, click "Manage domain wide delegation"

  9. On the next screen, add a new API client

    Specify the following scopes for your client: openid, email, profile, https://www.googleapis.com/auth/admin.directory.customer.readonly, https://www.googleapis.com/auth/admin.directory.group.readonly, https://www.googleapis.com/auth/admin.directory.user.readonly

  10. Navigate to the Defguard settings and upload the JSON file you obtained previously. Make sure to also input the email of the account on which behalf the API calls will be made. This account should have access to users and their groups (e.g. email of your account as an admin).

  11. Test if you properly set everything up by clicking the "Test connection" button.

This documentation concerns only the Google directory synchronization. For more general information, see the .

To learn more about the rest of the configuration options, see the .

Navigate to in the Google Cloud console

Now in the admin console, navigate to

Service Accounts
API controls
full Google documentation
Google Cloud Console
APIs & Services
Credentials
general directory synchronization guide
general directory synchronization guide