OpenBao OIDC login with Google Workspace groups

How to sign people in to OpenBao with Google as the OIDC provider, map Workspace groups to policies through domain-wide delegation, and restrict sign-in to your own domain.

On this page

How OpenBao OIDC login with Google Workspace groups works

An operations or security team that wants staff to sign in to OpenBao with their Google Workspace accounts and receive policies based on group membership can do this with the JWT/OIDC auth method, using Google as the OpenBao OIDC provider. The OpenBao Google OIDC guide describes the setup: you create an OAuth client ID of type Web Application in the Google API Console, register the redirect URIs OpenBao expects, and configure the JWT/OIDC auth method to trust Google as the identity source. Users authenticate with Google, OpenBao receives the identity token, and the token's claims are matched to policies. The sign-in itself does not require any group lookup, so a basic deployment can start with user identity alone and add groups later.

Group membership is optional and comes from a Google-specific extension. When you enable it, OpenBao fetches the user's Workspace group membership and profile information during login, so those values can be used for identity group alias association and claim mappings. This lookup depends on domain-wide delegation: a service account in your Google Cloud project is granted delegated access to the Admin SDK API, and it acts on behalf of a Workspace administrator account to read directory data. Confirm with your Workspace administrator who will own the service account, which admin scopes are granted, and how the delegation is reviewed, because a broadly scoped delegation gives OpenBao read access to directory data across your domain. Also confirm the exact scopes and steps against the current guide before you configure anything.

The internal OAuth application is the control that keeps sign-in limited to your organization. The guide recommends setting the OAuth application's user type to internal, because an external user type would allow any Google account to authenticate with OpenBao. Treat this as a go or no-go check before rollout: verify the user type in the Google API Console, then test with an account outside your domain and confirm it is rejected. Pair this with roles and bound claims in OpenBao so that a valid sign-in alone grants only the minimum policy, and confirm that group-based policy mappings are reviewed whenever group membership changes.

What you need before configuring Google login for OpenBao

Google login for OpenBao touches three systems: your OpenBao cluster, a Google Cloud project, and Google Workspace administration. Confirm each item below before anyone opens the Google API Console, because the redirect address and admin rights decide how much rework follows.

A reachable OpenBao cluster over HTTPS

Google redirects the browser back to OpenBao after sign-in, so the cluster needs a stable, HTTPS address that users can reach from their browsers. The redirect URIs are built from that address, so changing the hostname later means updating the Google OAuth client. Confirm the exact redirect URIs in the current Google provider guide against the address you plan to publish, and agree that address with your network team first.

Google OIDC guide

A Workspace super admin

Creating the OAuth client is possible for a project owner, but granting domain-wide delegation requires a Workspace super administrator in the Google Admin console. Identify who holds that role, who approves the change, and who will own the delegation after the project is handed over. Without this person, the group lookup step cannot be completed and you will be left with login but no group-based policy mapping.

A dedicated Google Cloud project

Put the OAuth client and the service account used for group reads in one dedicated Google Cloud project, separate from application projects. This keeps IAM, audit history and key rotation for the OpenBao integration in one place. Ask your cloud team who owns the project, which billing account it uses, and whether organization policies block service account key creation or external OAuth clients.

Admin SDK API enabled

Group membership is read through the Google Admin SDK API, so it must be enabled in the same project as the service account. Enabling the API is a one-time step, but changing who can call it is an ongoing control. Record the project, the service account identity and the API enablement in your change record so auditors can trace which identity reads directory data.

The group-read scope from the guide

The Google guide specifies the OAuth scope that allows OpenBao to read group membership, and domain-wide delegation must grant exactly that scope to the service account client ID. Grant the narrowest scope the guide names, not a broader directory scope chosen for convenience. Re-check the scope string against the current guide before granting it, because scope names and requirements can change between guide revisions.

An internal OAuth consent configuration

Set the OAuth application user type to internal so that only accounts in your Workspace domain can sign in. An external type would let any Google account authenticate with OpenBao, which is the wrong default for a secrets manager. Confirm before you start that your Workspace edition supports internal applications and that someone with authority over the consent screen is available to sign off.

Configuration sequence from Google OAuth client to policy mapping

This sequence takes an OpenBao instance from a Google Cloud project with no OAuth client to a working login where Workspace group membership drives policy assignment. Each step closes with a check, so a failure can be traced to the step that caused it before the next one starts.

  1. Create the OAuth web client in Google

    In the Google API Console, a project owner creates an OAuth client ID of type Web Application and registers the authorized redirect URIs that the OpenBao OIDC provider guide specifies for your OpenBao address. Record the client ID and client secret in your secrets store, not in a ticket or chat. The step is done when the client appears in the credentials list with the exact redirect URIs you entered, and a copy of the client ID is stored where OpenBao configuration will read it. Confirm the redirect URI strings against the guide, since a single character mismatch is the most common cause of a failed login at this stage.

  2. Set the OAuth application to internal

    Set the OAuth consent screen user type to internal so that only accounts in your Workspace domain can complete sign-in. The OpenBao guide recommends this because an external user type would allow any Google account to authenticate. Your Google Workspace administrator or the project owner makes this change. The check is a test sign-in from a personal Google account, which should be refused at the Google consent step before OpenBao receives any token.

  3. Enable the Admin SDK API

    Enable the Admin SDK API in the same Google Cloud project that holds the OAuth client. OpenBao uses it only when you turn on the optional group and user lookup, so this step can be skipped for a login that maps policies from claims alone. Your Google Cloud administrator completes it. The check is that the API shows as enabled in the project's API library, and that the project is the one your service account will belong to in the next step.

  4. Create the service account and delegate domain access

    Create a service account in the same project, generate its key file, and record the OAuth client ID of the service account. A Workspace super administrator then grants that client domain-wide delegation in the Admin console, limited to the read-only directory scope that group membership lookups require. Keep the key file in your secrets store and restrict who can read it. The check is a directory read for a known test user made with the service account and delegated subject, which should return that user's group memberships.

  5. Configure the JWT auth method with Google settings

    Enable the JWT auth method in OpenBao and configure it with Google's OIDC discovery URL, the OAuth client ID and client secret from the first step, and the bound issuer and redirect values that the Google guide lists. Add the optional group and user information settings that point to the service account key and the delegated admin subject. The resulting configuration is stored in OpenBao, not in version control with the secret values. The check is that reading the auth configuration returns the expected discovery URL and client ID, and that the secret value is not displayed in plain text.

  6. Create roles with bound claims and group aliases

    Create one or more JWT roles that set bound claims, such as the hosted domain claim, so that only tokens from your Workspace domain match a role. Add group alias configuration so that Workspace group membership maps to OpenBao identity groups, and those identity groups are attached to policies. Keep the role count small at first and name each role after the access it grants. The check is a role read that shows the bound claim and the group alias mapping you intended, with no role matching an empty or wildcard claim.

  7. Write policies scoped to each group

    Write least-privilege policies in HCL for each identity group, granting access only to the secret paths that group needs. Load them with the policy write command and attach them to the identity groups created from the aliases. Avoid granting the root policy or broad wildcard paths to any Workspace group. The check is a policy read for each one, plus a token capabilities test against an example path to confirm that a member of the group can read it and a non-member cannot.

  8. Test sign-in and negative cases

    Sign in through the OpenBao UI and the CLI with a Workspace account in each test group, then confirm that the token shows the expected identity alias and policies. Repeat the test with an account outside the group, and with an account outside the domain, which should be refused. Record the results with the group names and token policy output as your acceptance evidence. The step is complete when each positive test returns the expected policies, each negative test is denied, and the results are saved for your security review.

Which Google and Workspace attributes map to OpenBao identities and policies

This table traces each attribute Google returns at sign-in, and each Workspace group fetched through the Admin SDK, to the OpenBao field it fills and the policy decision it drives. Read it as a checklist: confirm each claim during role binding, then confirm group names against your own Workspace directory before writing policies. The main takeaway is that the hosted domain check and the internal application setting do the access control, while group aliases do the authorization.

Attribute or objectSource in the login flowOpenBao field or objectWhat to check before relying on it
Subject (sub)Google ID token claim, stable per Google accountEntity alias name for the Google identityTreat as the stable key. Do not key policies on email addresses, which can change.
EmailGoogle ID token claim, the user's primary addressEntity alias or entity metadata, used for audit readabilityConfirm the claim mapping you configure and whether it matches your audit log expectations.
Hosted domain (hd)Google ID token claim, present for Workspace accountsBound claim in the JWT role, limiting which accounts can match the roleSet the bound claim to your domain. Test with an account from another domain to confirm it is refused.
Workspace group membershipFetched during login through domain-wide delegation and the Admin SDK APIIdentity group, linked to the Google group through a group aliasGroup names are illustrative until confirmed in your Workspace admin console. Confirm the exact group addresses and that the service account can read them.
Groups to policiesIdentity group membership attached to OpenBao policiesPolicies attached to the identity groupGrant least privilege per group. Review membership after each directory change, since group changes affect the next login.
Internal user typeOAuth application setting in the Google API ConsoleNot an OpenBao field, but controls who can authenticate at allConfirm the application is set to internal. An external type would let any Google account sign in to OpenBao.

Why an internal OAuth application keeps sign-in to your domain

The OpenBao Google OIDC guide recommends creating the OAuth application with an internal user type, because an external user type would allow any Google account to authenticate with OpenBao. That distinction matters more than it first appears. OpenBao validates the identity token it receives from Google, but the token itself only proves that someone holds a valid Google account. If the OAuth client accepts external users, a personal Gmail account can complete the sign-in flow against your OpenBao endpoint, and whether OpenBao then grants any policy depends entirely on the roles and claim checks you configured. Treat the internal user type as the first gate, and confirm it in the Google Cloud console before anything else is tested.

Treat the hosted domain restriction and the bound claims in OpenBao as a second layer, not a replacement for the first. Confirm that the JWT role you define binds the hd claim to your Workspace domain, and that bound audiences and bound subjects or groups match what you intend to admit. Test with a personal account and with a user from a secondary domain you control, and record which requests OpenBao rejects and at what step. Ask your Google administrator whether any other Workspace domains or domain aliases are attached to the same tenant, because those may satisfy a loose domain check. Keep the role definitions in version control so changes to the checks are reviewed like any other access change.

Consent screen and client administration need deliberate ownership. An internal application shows consent only to users in your organization, which simplifies the screen, but the consent configuration, the OAuth client secret and the Google Cloud project that hosts them are still administrative assets. Decide who can edit the OAuth consent screen, rotate the client secret and change authorized redirect URIs, and restrict those rights to a small group in your identity or platform team. Review the project's IAM bindings, especially any roles that let someone create new OAuth clients or change the service account used for domain-wide delegation. Confirm with your Google Workspace administrator where the project sits in your organization, since its ownership determines who can change login behavior without involving OpenBao administrators.

Security settings for domain-wide delegation and login

Google sign-in and Workspace group lookups use two different trust paths: the OAuth client that lets people sign in, and the service account that reads directory data. Each card below covers one control on either path, and the set should be checked against your own security review requirements before go-live.

Restrict the OAuth client to internal users

Create the OAuth application with the internal user type. The OpenBao Google guide notes that an external user type would allow any Google account to authenticate with OpenBao. Confirm in the Google API Console that the consent screen shows your Workspace domain only, and test sign-in with an account from outside the domain before go-live.

Google OIDC guide

Keep redirect URIs exact

Register only the redirect URIs that OpenBao requires for your deployment, using the exact scheme, host, port and path. Avoid wildcards, leftover localhost entries and test hostnames. Each extra entry is a place where an authorization code could be sent to an endpoint you did not intend to trust.

Scope the service account to directory read

Grant the service account only the Admin SDK read scope needed to look up group membership and user information. Limit domain-wide delegation to that scope and to the one service account. Write down the exact scope string in your change record so an auditor can compare it to the grant in the Admin console.

Limit who holds the grant and key

Restrict the admin roles that can change domain-wide delegation and create service account keys to a named, small group. Store the service account key in your secrets system, or avoid long-lived keys where your Google configuration allows it. Review who holds these roles on a fixed schedule.

Protect the OAuth client secret

Keep the client secret out of configuration files, shell history and tickets. Load it into OpenBao through a controlled process and restrict read access to the auth method configuration. Plan rotation: create a new secret, update OpenBao, verify login, then revoke the old one.

Map admin groups to narrow policies

Group membership decides which OpenBao policies a user receives. Map Workspace groups that carry administrative meaning to the narrowest roles you can support, and keep root-equivalent or broad policies off group mappings. A group that is easy to join in Google becomes an access path in OpenBao, so confirm who can edit those groups.

Log logins and group lookups

Enable OpenBao audit logging and review login events alongside Google Admin audit logs for the service account and delegation changes. Confirm that logs record the identity, the mapped groups and the outcome of each login. Check that log storage and retention meet your review requirements before you rely on them as evidence.

How a Google login becomes OpenBao policies in four hand-offs

The flow starts when a user opens the OpenBao login and is sent to Google sign-in in the browser. Google returns an authorization code to OpenBao, which exchanges it for an ID token and checks that token. OpenBao then uses the service account with domain-wide delegation to ask the Admin SDK for group membership, and maps the user and groups to an identity alias and policies. Check the boundary: only the browser redirect and the ID token cross into your environment, while the group lookup is a server-to-Google call that needs its own credentials.

Login hand-offs between the user, Google and OpenBao, with the trust boundary marked.

Questions teams ask before configuring Google login for OpenBao

Who does the Google login configuration work, and what does it need from the team?

The work is done by two groups working in sequence: someone with Google Workspace admin rights who creates the OAuth client, the internal application and the service account, and someone with OpenBao admin rights who configures the JWT/OIDC auth method, roles and policy mappings. The Google side needs admin access to the Google API Console and the Workspace admin console, including the ability to grant domain-wide delegation for the Admin SDK. The OpenBao side needs root or equivalent administrative access to the target cluster. A written test plan is the third input: it should list which test accounts sign in, which groups must map to which policies, and what a denied login should look like. Confirm before starting who holds each of these rights, because they are often held by different teams.

What makes the Google OIDC setup take more effort?

Effort rises with the number of Google groups that must map to OpenBao policies, because each mapping needs a decision, a test and a record. Policy design is the next driver: least-privilege policies that differ by team take longer than a single admin role. The number of OpenBao environments matters as well, since development, staging and production each need their own redirect URIs, client settings and tests. Change control adds time where production changes need tickets, peer review or a maintenance window. Group lookup through domain-wide delegation adds a further layer, since the service account scope, Admin SDK access and the group fetch must be verified and documented separately from the login flow.

Can our team configure Google login for OpenBao alone using the guide?

A team with working knowledge of OpenBao auth methods and Google Workspace administration can usually follow the official Google OIDC provider guide without outside help. The guide covers creating a Web Application OAuth client in the Google API Console, the redirect URIs OpenBao needs, and the optional Google-specific settings for fetching group membership and user information. The points that most often need extra care are choosing the internal user type for the OAuth application, scoping domain-wide delegation to the minimum needed, and mapping group identities to policies in a way you can review later. Teams without someone who has done this before should plan a test cluster run first, so that mistakes are found before production users depend on the setup.

How long does the configuration take?

The duration depends mainly on approvals, not on the technical steps. Creating the OAuth client and running a login test can be quick once the right people are available, but granting domain-wide delegation, approving a new service account and getting policy mappings signed off often involve several reviewers. Each environment that needs its own change record adds another review cycle. This page does not state a duration. Ask your Google admin and your OpenBao owner to list every approval step, who signs each one and how long your change process usually takes, then use that list as the basis for your schedule.

What should a consultant scope for Google login include?

A written scope should name the environments covered, the Google Workspace domain and OAuth application, the OpenBao auth mount and roles, and the group-to-policy mapping table. It should list the service account and Admin SDK scope used for group lookup, the settings that restrict sign-in to your domain, and the test cases: an allowed user in each group, a user outside each group, and an account from outside your domain that must be refused. Deliverables should include the configuration record, a runbook for changing mappings and a retest after any change. Ask for the approvals the consultant expects you to obtain, and for what happens when a test fails. DeployOpen plans fixed-scope engagements agreed in writing before work starts, so the scope document is where these items are fixed.

Is Google group lookup required for Google login to work?

No. Google login can work with identity information alone, but the group lookup is what allows OpenBao to map a user's Workspace group membership to policies during login. Without group lookup, you need another way to assign policies, such as per-user entities or a separate process, which can be harder to audit. Group lookup adds a service account, domain-wide delegation and the Admin SDK, so it also adds administrative scope in your Google tenant. Decide whether group-based policy mapping is needed before you start, because it determines whether the extra delegation is justified. Confirm the exact fields and scopes against the Google guide for your version of OpenBao.

What risks should we review before turning on internal-only sign-in?

The main risk is an external user type on the OAuth application, which lets any Google account authenticate with OpenBao. The OpenBao guide recommends an internal user type for this reason, so confirm the setting in the Google API Console and test it with an account outside your domain. A second risk is over-broad domain-wide delegation, which can give the service account more access than group lookup needs. Review the granted scopes and restrict who can change them. Finally, confirm that policy mappings grant only the access each group needs, since a mapping mistake can grant broad access to every member of a group.

Common failures in Google OIDC login and group mapping

This table lists the failures teams most often hit when Google signs users into OpenBao and when Workspace groups fail to map to policies. Each row gives the likely cause and the check to run before retrying, so you can confirm the fix in your own environment. Work through the rows in order, because login problems hide group problems.

FailureLikely causeFix to verify
Redirect URI mismatchThe authorized redirect URIs in the Google OAuth Web Application client do not exactly match the callback URLs OpenBao uses, including scheme, host, port or trailing slash.Copy the redirect URIs from the OpenBao JWT/OIDC configuration into the Google API Console client, save, and retry a login in a fresh browser session. Confirm against the Google provider guide.
Any Google account can sign inThe OAuth application was created with the external user type, which lets any Google account authenticate with OpenBao.Confirm the OAuth consent screen uses the internal user type. If the type is wrong, plan a new client and test that an account outside your domain is refused.
Group lookup returns nothingDomain-wide delegation was not granted to the service account, or the client ID was entered incorrectly in the Admin console.In the Workspace Admin console, confirm the service account's client ID is authorized for domain-wide delegation. Retry login and check OpenBao audit or server logs for the lookup call.
Admin SDK calls are deniedThe Admin SDK API is not enabled in the Google Cloud project, or the delegated OAuth scopes omit the directory group read scopes the lookup needs.Enable the Admin SDK API in the project that owns the service account. Compare the granted scopes with the scopes listed in the Google OIDC guide, then test one lookup.
Service account key errorsThe JSON key was copied with line breaks or whitespace damaged, was stored in a shared location, was rotated without updating OpenBao, or belongs to a deleted service account.Re-create the key, store it in your secrets path with restricted access, update the configuration, and confirm a successful lookup. Delete the old key and record the rotation date.
Groups missing for some usersUsers are members of a nested group, of a group outside the scope the service account can read, or of a group that was not refreshed since the membership change.Test with a known user and a direct member group first. Ask the Workspace admin whether membership is direct or inherited through nesting, then confirm the group appears in a test lookup.
Policies not applied after loginThe group alias name or identifier does not match the value Google returns, often because of case, domain prefix or using an email where an ID is expected.Compare the alias name with the group value in a test login response. Correct the identity group alias, then log in again and confirm the expected policy is attached to the token.
Login works but mapping failsThe claim mapping or identity group alias was created before the Google groups lookup was configured, so the alias points to a value OpenBao never receives.Re-check the claim mapping and alias order after enabling the lookup. Remove stale aliases, recreate them, and verify with a token lookup for a test user in each group.

What to test and monitor after the integration goes live

Start with a written test matrix and run every case against the production-like OpenBao instance before users depend on it. First, sign in with an account from your primary Workspace domain and confirm the OpenBao UI or CLI receives the expected token and policies. Second, attempt sign-in with an account outside the domain, such as a personal Google account, and confirm it is refused. This second test is the one that proves the internal OAuth application actually works, because the Google provider guide recommends the internal user type specifically so that any Google account cannot authenticate. Third, sign in as a user in a mapped Workspace group and confirm the policies from the group-to-policy mapping are attached, and that a user outside the group does not receive them. Fourth, remove a test user from the group, wait for the change to reach your Admin SDK data, then sign in again and confirm the access is gone on the next login. Record the results, the OpenBao version and the Google settings used, so the evidence can be reproduced after upgrades.

Ongoing monitoring should focus on failed and unusual logins, since these are where misconfiguration and abuse appear first. Ship OpenBao audit logs to your central log platform and alert on repeated authentication failures from the JWT/OIDC auth mount, on logins from users who are not expected members of your domain, and on changes to the auth configuration itself. Also watch the service account used for domain-wide delegation: check its scopes in the Google Admin console on a regular schedule and confirm that only the Admin SDK read scopes needed for group lookup are granted. Confirm with your own team the lifecycle of the OAuth client secret and the service account key, including who owns them, where they are stored and how the rotation window is communicated. Rotation is a decision you control, so set the schedule to match your policy and test the rotation procedure in a non-production environment first.

Finally, treat Google-side changes as part of OpenBao's attack surface. Changes to the OAuth consent screen, the internal user type, the authorized redirect URIs or the delegation grants can silently widen access or break login. Re-run the out-of-domain refusal test and the group removal test after any change in the Google Workspace admin settings, after an OpenBao upgrade, and after any change to the auth mount configuration. Keep a short runbook that names the owner for each check and the steps to revoke an OpenBao token or disable the auth method if a compromise is suspected. Confirm the exact configuration keys and admin console paths against the current OpenBao Google OIDC guide and your Workspace edition, since the console layout can change.

How DeployOpen scopes, delivers and supports this integration

DeployOpen plans and implements OpenBao as self-hosted infrastructure in your own cloud accounts, data centers or air-gapped networks. For Google sign-in with Workspace group mapping, we agree the scope in writing first, then build and test the Google OAuth and OpenBao configuration together so your security and identity teams can review each step.

How we scope

  • Confirm that your Google Workspace is the identity source and which OpenBao users and groups need access.
  • Agree whether group membership fetched through domain-wide delegation drives policy mapping, or whether login alone is enough.
  • Record in the written scope who creates the OAuth application, the service account and the Admin SDK access in your Google tenant.

How we build

  • Configure the Google Web Application OAuth client with the redirect URIs OpenBao requires for your deployment address.
  • Set the OAuth application to an internal user type so that only accounts in your domain can authenticate with OpenBao.
  • Test the optional group lookup path, the claim mappings and the policies they assign, using accounts from each group in scope.

How we hand over

  • Deliver a configuration record covering the OAuth client, redirect URIs, service account scopes, JWT auth settings and claim mappings.
  • Document the group-to-policy mapping as a table so administrators can see who gets which access and why.
  • Walk your administrators through sign-in, group changes and rotation of the service account key, and record what each step requires.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing are available as a retainer if you want DeployOpen to keep the integration current.
  • Ask for a written quote based on your scope. Ask us to confirm which parts of the Google setup your own administrators will keep and which we will maintain.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.