Connect with Google Workspace

Create the service account Valkan uses to read your Workspace directory, OAuth grants and audit logs, then connect.

One-click connect

Where your Valkan deployment offers it, Connect Google Workspace opens Open Google Admin first. A Google Workspace super admin clicks Authorize: only super admins can grant domain-wide delegation.

  1. Enter the email of the account Valkan reads your directory as. It must be on your company's domain: one you signed in to Valkan with, or one a connected Workspace or Entra directory has verified. Valkan refuses any other domain, so no one can connect a Workspace their organization does not control. If you sign in to Valkan on a different domain (a consultant, or a second company domain), choose Advanced instead.
  2. Choose whether Valkan also lists the OAuth grants your employees made to apps (on by default; see the note below). Click Open Google Admin. A new tab opens Security → API controls → Domain-wide delegation with Valkan's client ID and scopes filled in.
  3. Sign in as a super admin, check Overwrite existing client ID if it is shown, and click Authorize. If the form is empty, click Add new and paste the client ID and scopes Valkan shows.

That is the last step. Valkan checks every 15 seconds; Google usually applies the change within a few minutes, but can take up to 24 hours. Then Valkan reads the directory as your admin, activates the connection and starts the first scan. You can leave the page: Valkan keeps checking in the background and finishes by itself while you remain an admin in Valkan; Sources shows the connection until then. A setup left for 14 days is removed.

The account Valkan reads as does not need to be a super admin. An admin role that can read users, groups, domains and reports is enough; the super admin is needed only to click Authorize.

The client ID belongs to a service account Valkan created for this connection only, in Valkan's own Google Cloud project. It has no key, and no other Valkan customer can use it. Nothing is created in your Google Cloud. To revoke access, delete the source in Valkan, which deletes that account, or delete the client ID under Domain-wide delegation.

If your deployment does not offer one-click connect, or your policy requires a service account you own, choose Advanced and follow the manual steps below.

Manual setup

Complete these steps before choosing Connect Google Workspace → Advanced in Valkan. Valkan reads your user directory, the OAuth grants your employees have made to third-party apps, and admin, token and Drive audit logs.

Two roles take part, often two people:

  • a Google Cloud project admin for steps 1–3 (creating the service account and its key)
  • a Google Workspace super admin for step 4 (domain-wide delegation)

Valkan only reads. It lists users, OAuth grants and audit events; it never creates, changes or deletes anything in your Workspace. One scope, admin.directory.user.security, is broader than that: it is the only scope Google offers for listing OAuth grants, and it also allows revoking grants and generating or reading users' backup verification codes, which can get past 2-step verification. Valkan calls only the list of grants. Without the scope, Valkan still connects and reports OAuth grants as not read; one-click lets you leave it out.

1. Create the service account

  1. Go to console.cloud.google.com/iam-admin/serviceaccounts.
  2. Click Create Service Account, name it (e.g. valkan-workspace), and click Create and Continue → Done. It needs no Google Cloud project roles.
  3. Open the service account and copy its Client ID — a long numeric string, not the JSON key. You'll need it in step 4.

2. Create a key

  1. On the service account, go to the Keys tab → Add Key → Create new key → JSON → Create.
  2. A file downloads — you'll paste its contents into Valkan in the last step.

Organizations created on or after 3 May 2024 block service account keys by default (the iam.disableServiceAccountKeyCreation policy). If Add Key is refused, ask an organization policy administrator to allow key creation for this project.

3. Enable the Admin SDK API

Go to console.cloud.google.com/apis/library/admin.googleapis.com in the project that owns the service account, and click Enable. It covers both the directory and the audit-log (Reports) calls; without it, every call fails with a 403 even when the scopes are correct.

4. Grant domain-wide delegation

A Workspace super admin does this step.

  1. Go to admin.google.com → Security → Access and data control → API controls → Manage Domain Wide Delegation → Add new.
  2. Paste the Client ID from step 1.
  3. Add these 5 scopes, comma-separated:
https://www.googleapis.com/auth/admin.reports.audit.readonly,
https://www.googleapis.com/auth/admin.directory.user.readonly,
https://www.googleapis.com/auth/admin.directory.customer.readonly,
https://www.googleapis.com/auth/admin.directory.domain.readonly,
https://www.googleapis.com/auth/admin.directory.user.security

Then click Authorize. If your organization requires multi-party approval, a second super admin must approve the change.

Add all five: Valkan requests them together, and Google refuses the whole request if any one is missing from the delegation.

Optional: Workspace groups

To see your Workspace groups and their members, also add this sixth scope:

https://www.googleapis.com/auth/admin.directory.group.readonly

It is optional. Valkan asks for it separately from the five above, so a delegation without it still connects and scans; the groups are simply not read, and the scan shows a coverage gap naming this scope. Groups appear under Identities → Groups & grants with their member users and nested groups. Up to 500 groups, and 2,000 members of each, are read; anything beyond is reported as a gap.

5. Connect in Valkan

  1. In Valkan, choose Integrations → Sources → Connect → Google Workspace.
  2. Paste the JSON key's contents.
  3. Enter the email of the admin Valkan will act as, and click Connect.

Use a super admin. A delegated admin with the Users → Read, Reports and User Security Management privileges may also work, but has not been verified.

Limits

  • Drive audit events are available only on Google Workspace Business and Enterprise editions, and mostly for files owned by users on those editions.
  • Admin role assignments are not read today: listing them needs a role-management scope that Valkan does not yet request.