Live
Smartsheet MCP integration: connecting Amazon Quick and Kiro on AWSLocal AI Hardware Expands with RTX Spark, DGX Spark Clusters, and Upcoming Windows DGX StationAI SRE context halves diagnosis latency and reduces tool callsGitHub CLI adds optional expiring OAuth tokens with automatic refreshDocker Sandbox + BAND AI Kit Enables Collaborative Agents in Isolated MicroVMsObjectRef GA: SQL‑Native Access to Cloud Storage Files for Multimodal PipelinesPractical Guide to IAM Roles Anywhere PKI Integration with Exportable ACM CertificatesReplacing Round‑Robin Load Balancing with GKE Inference Gateway to Quadruple Batch Inference ThroughputSmartsheet MCP integration: connecting Amazon Quick and Kiro on AWSLocal AI Hardware Expands with RTX Spark, DGX Spark Clusters, and Upcoming Windows DGX StationAI SRE context halves diagnosis latency and reduces tool callsGitHub CLI adds optional expiring OAuth tokens with automatic refreshDocker Sandbox + BAND AI Kit Enables Collaborative Agents in Isolated MicroVMsObjectRef GA: SQL‑Native Access to Cloud Storage Files for Multimodal PipelinesPractical Guide to IAM Roles Anywhere PKI Integration with Exportable ACM CertificatesReplacing Round‑Robin Load Balancing with GKE Inference Gateway to Quadruple Batch Inference Throughput
GitHub

GitHub CLI adds optional expiring OAuth tokens with automatic refresh

AI SummaryPowered by AI

GitHub CLI v2.103.0 now supports an opt‑in mode that stores short‑lived access tokens together with a refresh token and renews them automatically. This reduces credential exposure risk and removes the need for manual re‑authentication in CI/CD pipelines and local workflows.

Starting with version 2.103.0, the GitHub CLI can be configured to use expiring OAuth tokens that automatically refresh when needed. The change is optional and backward compatible, but it alters how credentials are stored and refreshed, which directly affects automation, git operations, and security posture.

How to Enable Expiring Credentials

To activate the feature for a single login, add the --expiring flag to the authentication command:

gh auth login --expiring

To make it the default for all future sign‑ins, set the configuration key once:

gh config set expiring_credentials enabled

After enabling, the CLI handles token refreshes in the background; no additional commands are required for day‑to‑day use.

Impact on Git Operations

If you use HTTPS for git, configure the CLI as the credential helper so it can supply and refresh the expiring token on demand:

gh auth setup-git

The helper works best with git version 2.46 or newer, which respects the token’s expiry and avoids caching it beyond its lifetime. Older git versions still function, but they emit a one‑time recommendation to upgrade.

Operational and Security Considerations

Expiring tokens are short‑lived, so any process that captures the token once and reuses it later will eventually encounter authentication failures. Scripts that call gh auth token and store the result should be updated to request a fresh token each time instead of caching the value. The CLI will fall back to a non‑expiring token if the server does not support refreshable credentials, preserving existing workflows. Future releases plan to make expiring tokens the default for new sign‑ins, so teams should evaluate current automation for compatibility now.

Related CloudNinjas coverage: security.

What This Means For Practitioners

Adopt the --expiring flag or the global config setting in a controlled environment, verify that your CI/CD scripts retrieve tokens on demand, and ensure git is upgraded to 2.46+ where possible. Monitor any automation that relies on long‑lived tokens and adjust it to handle refresh failures gracefully. By doing so, you limit the window of exposure for leaked credentials while maintaining seamless authentication across development and operations workflows.

Originally published atGitHub Changelog