GitHub Will Reject OAuth Callback URLs That Contain a Fragment From February 1, 2027. If Your Sign In With GitHub Lands on a Hash Route, Here Is the Ten-Minute Fix.
On November 30 GitHub posted a changelog entry that takes one minute to read and sets a hard date. Starting February 1, 2027, GitHub will reject OAuth authorization requests that use a redirect URI containing a URL fragment. If your OAuth app or GitHub App has a # anywhere in its callback URL, sign-in through GitHub stops working that day.
That leaves about two months. Most apps are fine, and the ones that aren't tend to be the kind a solo developer set up once in 2021 and hasn't opened since.
What the changelog says
The entry is titled "Deprecating redirect URI fragments for OAuth and GitHub Apps." The affected group is stated plainly: any GitHub App or OAuth app that registers a callback URL containing a # fragment. After the cutoff, developers can no longer register or use such a URL.
GitHub's reason is twofold. Redirect URIs with fragments are not part of the OAuth 2.0 specification (the post cites RFC 6749), and they are a security risk because, in GitHub's words, "a fragment can be used to intercept an authorization code or token" during a redirect.
The change applies to github.com on Free, Team and Enterprise Cloud plans. GitHub Enterprise Server is not affected.
Between now and February, GitHub says app owners will see a warning in their app settings, and users signing in through an affected app will see a caution message. The post gives no start date for either.
What it leaves out
Three things I went looking for and did not find. The entry does not give the error a rejected request will return, so you can't write a test against it yet. It does not mention a brownout or phased rollout, which GitHub has used for other deprecations. And it says nothing about the device flow.
The absence of a stated brownout is the part I'd take seriously. With no rehearsal on the calendar, the first time you find out may be a user email on February 1 saying login is broken.
Who has a fragment in a callback URL
This part is my reading, since the changelog does not describe typical cases. The setup I'd expect to be hit is a single-page app with hash-based routing, where every route lives after a #. If the app handles the OAuth return inside the client router, the registered callback looks like this:
https://app.example.com/#/auth/callback
Hash routing was the easy answer for apps on static hosts that couldn't rewrite paths, which describes a lot of side projects on GitHub Pages or a bare S3 bucket. Browser extensions and Electron apps with odd redirect pages are the other place I'd look.
The apps most at risk are the ones you forgot exist: a staging OAuth app, a demo for a client, an internal tool with three users. Each has its own callback URL registered separately.
The check I'd run
Start in GitHub. Under Settings, then Developer settings, open both the OAuth Apps list and the GitHub Apps list, and read the callback URL field on every entry. If you own apps under an organization, repeat it in that organization's settings. Any # is a hit. GitHub says it will show a warning there too, but I wouldn't wait for it.
Then check the code, because the registered URL and the URL your app sends in the authorization request both matter. The request carries a redirect_uri parameter, and that is the thing GitHub says it will reject.
grep -rn "redirect_uri" src/ | grep "#" grep -rn "callbackURL\|callback_url\|redirectUri" src/ .env* | grep "#"
Check environment variables on your host as well. A callback URL set in a dashboard in 2022 will not show up in a grep of the repo.
The fix
The changelog's instruction is one sentence: remove the fragment. For a hash-routed app that means the callback needs to be a real path.
The smallest change I know of is a plain callback path that hands off to the router. Register https://app.example.com/auth/callback, serve a page there (on a static host, a tiny auth/callback/index.html works), read the code and state from the query string, and then navigate to whatever hash route you used before. The OAuth round trip never touches a fragment, and the rest of the app keeps its routing.
If your app exchanges the code on a server, the cleaner version is to point the callback at the server endpoint and redirect to the client afterwards. Either way, update the registered URL and the redirect_uri your code sends in the same deploy, or you'll trade a February failure for one today.
Then sign in once on production with a fresh browser profile. It is a two-minute test for a change to a login flow.
Where this could be wrong
I may be overstating how many apps have this. Most auth libraries and most tutorials use a path callback, and a server-rendered app would have no reason to use a fragment. If the settings pages show no #, you are done in five minutes and this post cost you nothing.
GitHub could also add brownouts or move the date. The post doesn't promise either, so I would plan on February 1 as written.
What I'd actually do
Open the two settings lists today and read every callback URL. It takes less time than reading this post did. If one has a fragment, ship the plain-path callback this week, while the old URL still works and you can roll back. I'd also delete any OAuth app I no longer recognize while I'm in there. February 1 is a Monday, and a broken login is a bad way to start one.
Author
Lukas
@lukcombinator