Codiatech Blog

GitHub Will Require Eight-Hour User Tokens for New Apps

Prepare for GitHub's eight-hour user token requirement by testing refresh, concurrent jobs and reauthorization before registering a new app.

A diagram beside test devices shows different expiry points for access and refresh tokens.

Starting January 5, 2027, newly registered GitHub Apps and OAuth apps on GitHub.com and GHE.com will support only expiring user access tokens. The eight-hour lifetime was already the default for new apps. GitHub is removing the option to turn expiration off during registration. Previously issued tokens keep their existing terms. GitHub changelog

Test the Integration Beyond the Eight-Hour Mark

A successful sign-in only covers the start of the flow. If a portal, background job or developer tool calls GitHub on a user's behalf, run a job with a test account after its access token expires. Confirm that the application uses a valid refresh token to get a new token pair and completes the job without asking the user to sign in again.

A successful refresh returns a new access token and a new refresh token. The previous pair stops working. Save both values in a single transaction and serialize refresh attempts for the same user.

A whiteboard sequence diagram crosses out the previous token pair and shows a replacement pair.

  • Start two jobs that need a refresh at the same time and verify that both can use the current credentials.
  • When the refresh token has expired or been revoked, stop the job and give the user a way to authorize the app again.
  • Keep enough context in logs to diagnose a failure. Exclude token values from logs, traces and support output.

Inventory Existing Tokens

The registration requirement leaves previously issued non-expiring tokens in place. Identify which jobs act as users and which run under a GitHub App installation. Revoke access that is no longer needed and assign an owner to each integration that needs to move. GitHub App token refresh documentation · OAuth app authorization documentation

For help adapting identity and authorization flows in existing applications, see Codiatech's system integration service.

The images are original AI-generated editorial illustrations.

Primary source: blog.github.com