Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

google-workspace-id-token-verifier

Latest version: v0.1.2

Overview

Last scanned
28 Nov 2026
Published
28 Nov 2026
npm package Publisher: yicr
0 Stars
0 Forks
3 Versions
TypeScript Repo language

Scan summary

google-workspace-id-token-verifier was last scanned on 28 Nov 2026 at version 0.1.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 3 versions, all published on 28 Nov 2026.
  • Findings: No rules fired in version 0.1.2.

Versions

3 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.2 LATEST 28 Nov 2026 No rules fired
0.1.1 28 Nov 2026 No rules fired
0.0.0-stage 28 Nov 2026 Not shown

No rules fired in 0.1.2

Findings

Findings for v0.1.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.2; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Google Workspace Id Token Verifier

npm version license Node.js build

Verifies a Google ID token and accepts only email-verified users in the configured Google Workspace domains.

A failure to download Google's verification certificates is reported separately from a rejected token.

Features

  • Accepts a Google ID token whose hosted domain (hd) is one of the configured Workspace domains
  • Requires email_verified to be true, unless that check is turned off
  • Reports a certificate download failure separately from a rejected token

How it works

GoogleWorkspaceIdTokenVerifier.verify asks google-auth-library verifyIdToken to check the signature, aud, exp, and iss. This package does not check those claims itself.

It then accepts the token only when all of the following hold:

  • hd equals one of workspaceDomains. A token with no hd is a personal Google account and is rejected.
  • email_verified is true, unless requireEmailVerified is false.
  • sub and email are non-empty.

The email address domain is not an allow list. An address at a Workspace domain can be created outside that Workspace, so the hosted-domain claim is the check.

The accepted result includes payload, the verified token payload, for further checks by the caller.

verifyIdToken uses the same Error type when the token is bad and when Google's verification certificates cannot be downloaded. This package splits those outcomes:

  • GoogleWorkspaceIdTokenVerifierInvalidIdTokenError means the token was rejected. Respond with 401. The message does not include the token. reason is there for logs.
  • GoogleWorkspaceIdTokenVerifierCertificateFetchError means the certificates could not be downloaded. Respond with 5xx. The original error is cause. A 401 would make a Google outage look like the caller presented a bad token.

Check the specific error class before the base GoogleWorkspaceIdTokenVerifierError.

Installation

npm
npm install google-workspace-id-token-verifier
yarn
yarn add google-workspace-id-token-verifier
pnpm
pnpm add google-workspace-id-token-verifier

Usage

Create one verifier for each client ID set and domain set, outside the handler, and reuse it. OAuth2Client caches the certificates on that instance.

import {
  GoogleWorkspaceIdTokenVerifier,
  GoogleWorkspaceIdTokenVerifierCertificateFetchError,
  GoogleWorkspaceIdTokenVerifierInvalidIdTokenError,
} from 'google-workspace-id-token-verifier';

const verifier = new GoogleWorkspaceIdTokenVerifier({
  clientIds: ['your-client-id.apps.googleusercontent.com'],
  workspaceDomains: ['example.com'],
});

export const handler = async (idToken: string) => {
  try {
    const identity = await verifier.verify(idToken);
    return {
      statusCode: 200,
      body: JSON.stringify({ sub: identity.sub, email: identity.email }),
    };
  } catch (error) {
    if (error instanceof GoogleWorkspaceIdTokenVerifierInvalidIdTokenError) {
      return { statusCode: 401 };
    }
    if (error instanceof GoogleWorkspaceIdTokenVerifierCertificateFetchError) {
      return { statusCode: 500 };
    }
    throw error;
  }
};

Any one client ID and any one hosted domain is enough:

new GoogleWorkspaceIdTokenVerifier({
  clientIds: [
    'client-a.apps.googleusercontent.com',
    'client-b.apps.googleusercontent.com',
  ],
  workspaceDomains: ['example.com', 'other.example'],
});

Skip the verified-email check:

new GoogleWorkspaceIdTokenVerifier({
  clientIds: ['your-client-id.apps.googleusercontent.com'],
  workspaceDomains: ['example.com'],
  requireEmailVerified: false,
});

Options

new GoogleWorkspaceIdTokenVerifier(policy, options?)
GoogleWorkspaceIdTokenPolicy
Name Type Required Description
clientIds readonly string[] Yes OAuth client IDs accepted as aud. Any one match is enough.
workspaceDomains readonly string[] Yes Workspace hosted domains accepted as hd. Any one match is enough.
requireEmailVerified boolean No When omitted, email_verified must be true. Set false to skip that check.
GoogleWorkspaceIdTokenVerifierOptions
Name Type Required Description
client OAuth2Client No Client from google-auth-library used to verify the token. When omitted, one client is created and reused for this instance.

Requirements

  • Node.js >= 20.0.0

License

This project is licensed under the Apache-2.0 License.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm google-workspace-id-token-verifier

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Frame 2085668439 (1)
Group 1261154229