AI NewsDev toolsAnnouncement

GitHub makes expiring user tokens mandatory for new Apps on 5 January

From 5 January, a new GitHub App or OAuth app must use expiring user tokens.

AI News

Editorial2 min read

LinkedInX
GitHub changelog cover for the expiring user tokens change

Image: GitHub

Why it mattersA leaked user token is live for only eight hours. A new app that skips refresh handling stops working after that.

A leaked GitHub user access token keeps working until somebody notices. From 5 January 2027, that stops being true for new apps. GitHub said so in a changelog post on 4 December. Every new GitHub App and OAuth app must use expiring user tokens. There is no way to opt out.

A new user token now expires after eight hours. After that, the app uses a refresh token to get a new one. The user does not have to sign in again. The rule applies on GitHub.com and on GHE.com.

What changes on 5 January

Right now, a developer can turn off user token expiration in the settings page. From 5 January, that setting is gone, GitHub says. An app registered before the date keeps its current tokens. GitHub does not change tokens that already exist.

The move only touches user access tokens. An app gets a user token when a user signs in to it. Server-to-server tokens are not part of this change. Those are the tokens an app uses to act as itself.

What a developer has to do

Before registering a new app, the auth code has to handle refresh tokens. The flow has three steps. The app gets a short-lived user token and a refresh token. It uses the first one for API calls. It swaps the second one for a new pair when the eight hours run out.

GitHub points to its docs on refreshing user access tokens and on the OAuth app authorization flow. Many existing libraries already handle this, GitHub writes. A developer who wrote the auth code by hand against the old default has to add the refresh step. A registration that goes in without it will succeed. The app then stops working after eight hours.

Why only new apps

The staged rollout keeps the change from breaking anything live. A team that runs an app under the old setting carries on. A team building a new app has one setting to think about. It also has a short window to get it right. GitHub does not say when, or if, the rule will reach existing apps.

The reason GitHub gives for the change is simple. A user token with no end date is live from the day it was issued. A leak, a backup that fell into the wrong hands, a laptop a former contractor kept: each of those is a live token until someone revokes it by hand. An eight-hour window limits that problem most of the time.

An AI coding agent often signs in to GitHub on a user's behalf. For that kind of app, this setting caps how long a leaked credential stays live. The answer to "how long does a stolen token work for?" is now a number in hours.

Source

GitHub changelog.

SourceGitHub

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project