INFINITE UPSIDE

Technology and operations

Access Tokens vs. Refresh Tokens: Why Are There Two?

A connection can be active, a token can expire, and the next request can still fail. Those are three different facts.

A team connects its scheduling app to a calendar. For a while, appointments appear as expected. On Monday, the integration reports that its access token has expired. Someone asks whether the entire account connection is broken. Maybe—but the word expired alone does not answer that question.

An OAuth access token is a credential a client presents to a resource server for authorized access. A refresh token, when one is issued, is a separate credential the client presents to the authorization server to obtain a new access token. The OAuth 2.0 framework distinguishes these roles and makes issuing a refresh token optional. A provider can also impose its own lifetime, scope and operational rules.

The distinction matters to anyone responsible for an integration, even if someone else writes the code. It helps separate a routine renewal from lost permission, a misconfiguration from a security incident, and a failed calendar update from an appointment that never existed.

Follow one calendar update

In a hypothetical setup, a calendar owner authorizes a scheduling application to work with a particular calendar. The scheduling application is the client. The service that issues credentials acts as an authorization server; the API that accepts calendar requests is a resource server. A single provider may operate both server roles, but they perform different jobs.

After an appropriate authorization flow, the application receives an access token. It presents that token when requesting a permitted calendar operation. The resource server checks whether the credential is valid for the request. A token may have an expiry, an audience or resource restriction, and scopes describing authorized access. The exact checks and scope names depend on the provider.

The access token is not necessarily the user’s password. Nor does it automatically authorize every endpoint offered by the provider. A read-only authorization should not be assumed to permit creating or deleting events. An API response can also fail because the requested calendar is inaccessible, the account has changed, or the request is malformed; renewal is not a universal repair button.

Where the refresh token goes

If the authorization server issues a refresh token, the client can use it at the token endpoint to request another access token under the applicable grant. The refresh token is meant for the authorization server, not for the calendar API. The framework’s refresh-token section makes that separation explicit.

The token response may include a replacement refresh token. When it does, the client needs to retain the replacement according to the provider’s rules rather than continuing to assume the previous value will work. It also needs to keep credentials confidential in transit and storage. Putting either token in a support ticket, a shared screenshot, a URL, or application logs creates a separate problem from the one the team is trying to debug.

Not every authorization produces a refresh token. Some connections need a fresh authorization, and some non-user integrations use a different grant or credential arrangement. Ask what the provider actually issued and which flow the application uses before building a process around a token that may not exist.

Expiration is a clock; permission is a decision

Imagine an access token with a provider-defined lifetime of one hour. The application may be able to refresh it without bothering the calendar owner. But a refresh request can be rejected if the underlying authorization was revoked, the refresh token expired, the client configuration is wrong, or the provider requires another step. The provider’s documented error response is evidence to investigate, not a reason to try the same request indefinitely.

Now imagine the owner removes calendar access while the original access token is still within its stated lifetime. Whether that token is rejected immediately depends on the provider’s revocation and validation design. A printed expiration timestamp is not proof that permission remains valid until then. Likewise, a successful refresh is not proof that the specific calendar or operation is authorized.

Treat ‘connected’ as a small set of observations: which account granted access, what scopes were granted, when the last credential exchange succeeded, and whether the target request succeeded. A green badge based only on a saved credential can be comforting right up until the first appointment is missed.

Rotation changes the failure story

Some providers rotate refresh tokens: a successful refresh returns a new one, and the earlier value is no longer usable under the provider’s rules. If two application workers both read the same old token and refresh at nearly the same time, one may replace it while the other is still trying to use it. The outcome depends on the service’s implementation, including any documented grace behavior. Do not assume every provider responds the same way.

The current OAuth security best practice describes refresh-token rotation and sender-constrained tokens as ways to detect or prevent replay for public clients. It also explains that detecting reuse can lead to revoking the active token because the authorization server cannot always distinguish the legitimate client from an attacker. See RFC 9700’s refresh-token guidance.

An application can reduce self-inflicted collisions by coordinating refresh work for a particular connection and updating the stored token pair safely. That requires careful design: an error after a remote refresh but before the replacement is saved is different from an error before the server received the request. Check the provider’s recovery guidance; do not quietly overwrite a newer credential with a stale one just because a worker finished later.

What to inspect when an integration stops

Start with the affected connection and the exact operation. Was the failure during renewal, or did renewal succeed and the calendar API reject the event request? Record the time, provider error category, target resource and a safe correlation identifier. Avoid recording credential values. A generic ‘authentication failed’ message often hides the more useful distinction.

Then check the authorization’s scope and account. A user may have switched organizations or authorized a different account from the one that owns the calendar. A scope change may require an explicit new consent flow rather than a retry. A permissions problem at one calendar does not prove all calendars under that account are inaccessible.

Separate credential recovery from business recovery. If the app failed to create an appointment, determine whether the provider accepted it before a timeout. Blindly issuing another create request can produce a duplicate. Use the provider’s documented identifiers, lookup mechanisms or idempotency support when available, and reconcile the resulting calendar entry with the original request.

Separate the grant from the token format

Teams sometimes inspect a token and assume its appearance tells them everything about the authorization. That is a poor diagnostic habit. An access token can be an opaque value to the client; some systems use a structured token format. A client should follow the provider’s documented contract, and a resource server must perform the appropriate validation rather than trusting an unverified field merely because it can be read.

Nor is an access token interchangeable with an identity token in systems that use both. One may be intended for an API while the other describes an authentication event to a client. Check the expected audience and purpose for the actual flow. Treating every token as a generic proof that a user may perform every action can turn a routine integration bug into an access-control problem.

A practical ownership record should identify the integration owner, affected account, authorized scope and support path without storing secret values in the record itself. If the provider changes its requirements, the team can find the connections that need review without asking users to reveal credentials. The record should also identify how the integration is disabled when the business no longer needs it.

Plan for the human moment

A good reconnection message identifies the affected service and account in a way the user can recognize, explains the practical consequence, and offers the ordinary authorization path. It should not ask the user to paste a token into a chat or send a password to support. If the problem is a service outage, asking every customer to reconnect can add work without fixing the outage.

Test the path before an incident: authorize a test account, make a permitted call, observe a normal renewal, and confirm what the provider does when access is revoked. Use test data and the provider’s documented environment. Include the handoff when a user must consent again; a technically correct refresh routine is not a complete recovery plan if nobody knows who can approve the renewed access.

The useful operating question is not ‘Does the token exist?’ It is ‘Can this authorized connection perform the intended operation, and can we recover safely when it cannot?’ The answer belongs in monitoring, support instructions and the design of the integration—not just in a secret field in a database.

Explore Infinite Upside

For Vijay Sheth’s personal accounts, read Infinite Upside: Building Wealth With Room to Live, published by Sheth Capital, Inc.

Find your edition · Chapter companion

ABOUT THE CONTRIBUTOR

Luna Lim

DIRECTOR OF FINANCIAL RESEARCH & EDITORIAL STRATEGY

SHETH CAPITAL, INC.

Luna Lim writes about business, investing, and the judgment behind financial decisions. She joined PCH Exotics Inc. as Director of Operations in 2022, working across La Jolla and Miami. Today, she reports directly to Vijay Sheth at Sheth Capital, Inc., bringing an operator’s perspective to the ideas she covers.

Based in Pacific Beach, California, Luna is curious about the people behind the numbers: what they’re building, how they weigh uncertainty, and what makes a risk worth taking. Her articles for Infinite Upside follow those questions through the details, with clear explanations and a feel for how decisions play out in everyday business.

More from Luna Lim

The Infinite Upside store