By NHI Mgmt Group Editorial TeamPublished 2026-01-26Domain: Workload IdentitySource: WorkOS

TL;DR: OAuth redirect flows, refresh handling, and token storage are abstracted so applications can request usable access tokens for Google Calendar and other connected services without building credential plumbing themselves, according to WorkOS. That removes implementation burden, but it also shifts trust, scope management, and lifecycle governance into a managed integration layer.


At a glance

What this is: This is a tutorial on using WorkOS Pipes to connect Google Calendar and fetch refreshed access tokens without implementing OAuth in the application.

Why it matters: It matters because managed token brokering changes where IAM, NHI, and lifecycle controls need to sit when applications rely on third-party data sources and delegated access.

👉 Read WorkOS's tutorial on syncing Google Calendar with Pipes


Context

OAuth complexity is often not in the API call itself, but in the credential lifecycle around it: redirect handling, token refresh, storage, and scope changes. For identity teams, that is an NHI governance problem as much as an application engineering problem, because the application is now depending on a reusable non-human credential path to reach external services.

WorkOS Pipes moves those mechanics into a managed layer so the app can ask for a usable token when needed. That simplifies integration design, but it also means practitioners have to treat the integration boundary, token scope, and reauthorization path as part of the control surface rather than assuming the application owns the whole access flow.


Key questions

Q: How should security teams govern brokered OAuth connections in applications?

A: Treat brokered OAuth connections as governed non-human identities. Assign an owner, record the provider scope, define the revocation path, and include the connection in access review and offboarding. If the application can still call the provider after the business need ends, the lifecycle control is incomplete.

Q: Why do managed token brokers change NHI governance requirements?

A: They move credential handling out of application code, but they do not remove the credential itself. That shifts governance to the integration layer, where teams must manage storage, refresh, scope, and reauthorization. The control problem changes location, not nature.

Q: What breaks when third-party access is not tied to lifecycle offboarding?

A: Connections can remain active after the user, contractor, or business case has ended, leaving standing delegated access in place. That creates unnecessary exposure because the application still has a valid path to provider data. Offboarding has to include the connection, not only the account.

Q: How do teams know if delegated scope is staying within policy?

A: Look for scope drift, repeated reauthorization exceptions, and access paths that expand without a new approval decision. If a read-only connection quietly becomes a broader integration pattern, the team is no longer operating at the original policy boundary. Review the scope each time the use case changes.


Technical breakdown

Managed OAuth brokering for application-to-provider access

WorkOS Pipes acts as a broker between an application and a third-party provider such as Google Calendar. The application does not run the full OAuth redirect and refresh workflow itself. Instead, the widget establishes the user connection, while the backend requests a usable access token from WorkOS when an API call is needed. This pattern reduces implementation complexity, but it also centralises trust in the intermediary that stores and refreshes the underlying credentials. The practical effect is that token lifecycle controls, scope enforcement, and reauthorization logic move out of app code and into the managed integration boundary.

Practical implication: review the brokered token path as a governed NHI dependency, not just an SDK convenience.

Token refresh and expiry in delegated access flows

The article describes refreshed access tokens and one-hour widget tokens, which shows the difference between session access for the UI and provider access for the backend. In practice, this creates two separate identity surfaces: the user-facing connection experience and the machine-facing token used for provider APIs. If scopes change, the user disconnects, or the provider requires reauthorization, the access path needs to fail cleanly and direct the user back to the widget. This is the same class of lifecycle problem that appears in service-account governance: access is only useful if the refresh and recovery path is reliable.

Practical implication: align token expiry, scope changes, and reauthorization handling with your access review and offboarding process.

Google Calendar scope control and least-privilege boundaries

The tutorial uses Google Calendar read-only scope, which is the right place to think about least privilege in brokered integrations. Scope is not just a configuration detail. It defines the outer boundary of what the connected credential can do, and it should be matched to the exact data flow the application needs. If the application later needs write access or additional calendars, that is a deliberate privilege expansion, not a routine code change. Good NHI governance treats scope creep as a lifecycle event, not an engineering convenience.

Practical implication: tie scope approval to business use case, then revalidate it whenever the integration expands.


Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Brokered OAuth shifts NHI governance from code to control plane: Pipes removes the need for every application team to implement OAuth plumbing, but it does not remove the identity problem. The credential still exists, the token still refreshes, and the scope still governs exposure. That means the real control point becomes the integration layer, where storage, rotation, and reauthorization are now concentrated. Practitioners should treat the broker as part of the NHI estate, not as an app convenience.

Managed token access creates a lifecycle dependency, not just an authentication shortcut: The important question is no longer whether the app can call Google Calendar, but how that access is revoked, narrowed, or reapproved over time. If the connected account outlives the business need, the governance gap looks like any other standing NHI privilege problem. The implication is that access review and offboarding logic must extend to delegated third-party connections.

Scope is the policy boundary, and scope drift is the hidden failure mode: Read-only calendar access is manageable because the privilege is explicit. The risk appears when teams treat broader provider access as a routine extension of the same integration pattern. That creates privilege growth without corresponding governance. The named concept here is delegated token drift: access that starts as a narrow connection and expands faster than review, approval, or audit can keep up. Practitioners should flag every scope expansion as a new control decision.

OAuth abstraction does not eliminate accountability for third-party access: The article shows that the application no longer owns the full flow, but the organisation still owns the outcome. The managed layer can reduce implementation burden, yet it can also obscure where credentials live and who is responsible when a connection persists too long. IAM teams should assume the control gap has moved, not disappeared.

Integration convenience is now a governance design choice: The more products depend on token brokers and connection widgets, the more identity governance must be designed around upstream delegation chains rather than only around local app logins. That affects SaaS access, NHI offboarding, and the way security teams audit which systems can still act on behalf of users. Practitioners should map every managed connector to an accountable owner and a revocation path.

From our research:

  • 91% of former employee tokens remain active after offboarding, leaving organisations vulnerable to potential security breaches, according to The 2025 State of NHIs and Secrets in Cybersecurity.
  • 62% of all secrets are duplicated and stored in multiple locations, causing unnecessary redundancy and increasing the risk of accidental exposure.
  • That lifecycle failure pattern is why the Guide to the Secret Sprawl Challenge is relevant when teams assess managed token brokers and delegated access paths.

What this signals

Delegated token workflows are becoming part of the identity perimeter: As more applications outsource OAuth handling, security teams need to map where the real credential lifecycle now lives. The governance question is no longer only who authenticated, but which system can continue to act after the original user action has ended.

The practical signal for IAM and NHI programmes is simple: if a connection widget can restore access faster than your review process can remove it, the control boundary has shifted. Teams should trace connected accounts, revocation events, and scope changes with the same discipline used for privileged machine identities.


For practitioners

  • Classify brokered connections as governed NHIs Inventory every managed provider connection as a non-human identity dependency, including the owning application, business purpose, scope, and revocation path. Treat the brokered token as part of your NHI register, not an invisible implementation detail.
  • Bind scope approval to explicit use cases Approve provider scopes only after confirming the data the application actually needs. Reassess any move from read-only to write access, and require revalidation when scopes widen or new providers are added.
  • Test reauthorization and disconnect flows Verify what happens when a user disconnects a provider, reauthorization fails, or a token expires before the next backend call. The application should return to a controlled connection path instead of silently retrying with stale access.
  • Extend offboarding to delegated third-party access When a user leaves, a contractor ends, or a business relationship changes, revoke connected provider access as part of the same offboarding workflow. Do not leave token recovery and connector removal outside the lifecycle process.

Key takeaways

  • Managed OAuth brokering simplifies application development, but it also concentrates token lifecycle risk in a smaller number of control points.
  • The relevant governance issue is not just access creation, but how delegated access is reviewed, narrowed, and revoked over time.
  • Scope expansion and offboarding need to be treated as lifecycle events for connected non-human identities, not as incidental application changes.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-03Brokered tokens still need lifecycle control and rotation discipline.
NIST CSF 2.0PR.AA-01Managed connections still require clear identity and access accountability.
NIST Zero Trust (SP 800-207)SP 800-207Continuous verification matters when access is delegated through a broker.

Track delegated tokens as governed assets and revoke or rotate them when access is no longer needed.


Key terms

  • Brokered OAuth Connection: A brokered OAuth connection is a delegated access path where a third party manages the token exchange, storage, or refresh process between an application and an external service. The application consumes usable tokens without owning the full credential lifecycle, which shifts governance to the brokered integration layer.
  • Delegated Token Drift: Delegated token drift is the gradual expansion of a connected account's access beyond its original approval boundary. It happens when scopes widen, connections persist after the business need changes, or review processes do not keep pace with the integration lifecycle. The result is standing access that no longer matches intent.
  • Managed Non-Human Identity: A managed non-human identity is a machine or application credential whose lifecycle is controlled by a platform or intermediary rather than by the consuming application alone. It can simplify implementation, but the organisation still owns scope, ownership, review, and revocation decisions.
  • Scope Boundary: A scope boundary is the defined limit of what a delegated token or connected account is allowed to do. It is set by provider permissions and business intent, then enforced operationally through review and reauthorization. When the boundary is vague or widened informally, privilege creep follows quickly.

Deepen your knowledge

OAuth brokering, token refresh, and delegated access lifecycle are covered in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building controls for managed connections like these, it is worth exploring.

This post draws on content published by WorkOS: Sync Google Calendar events without OAuth using WorkOS Pipes. Read the original.

NHIMG Editorial Note
Published by the NHIMG editorial team on 2026-01-26.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org