News 4 min read

GitHub will reject OAuth redirect URIs with fragments from Feb 2027


GitHub will reject OAuth authorization requests whose redirect URI contains a URL fragment (the part after #) starting February 1, 2027. The change, announced in the GitHub changelog on November 30, 2026, covers both OAuth apps and GitHub Apps, and from that date you also won’t be able to register a callback URL with a fragment. If your “Sign in with GitHub” flow sends users back to something like https://example.com/#/callback, it will stop working unless you change it before then.

What’s new

  • Enforcement date: February 1, 2027. After that, an authorization request that uses a redirect URI with a fragment is rejected, and callback URLs with fragments can no longer be registered.
  • Until then: apps that are affected show a warning in their settings on GitHub, and people signing in through such an app see a caution message.
  • Who it covers: github.com on the Free, Team and Enterprise Cloud plans. It does not apply to GitHub Enterprise Server, the self-hosted product.
  • Both app types: the rule is the same for OAuth apps and for the user authorization callback URL of GitHub Apps. Both docs pages now carry a note with the same example of a URL that will fail: https://example.com/callback#section.

Why GitHub is doing it

The OAuth 2.0 specification never allowed this. RFC 6749, section 3.1.2 says plainly that “The endpoint URI MUST NOT include a fragment component.” GitHub has accepted such URIs anyway until now. Its changelog gives the security reason for closing the gap: a fragment can be used to intercept an authorization code or token during the redirect. The fragment is handled entirely in the browser and is never sent to your server, which makes it a poor place for anything in a sign-in flow.

What it means for developers

Apps whose callback URL is a plain path such as /auth/github/callback need no change. The apps most likely to be caught are:

  • Single-page apps that use hash routing, where every route lives after # (https://app.example.com/#/oauth/callback). Angular, Vue and React apps built with a hash router may have registered their callback this way.
  • Apps that pass a fragment in redirect_uri to jump to a section of a page after sign-in, even if the registered callback URL itself is clean.
  • GitHub Apps with several callback URLs. A GitHub App can register up to 10, so check all of them, not just the first.

How to fix it

GitHub’s docs give one instruction: remove any fragments from your app’s callback URLs and from the redirect_uri values your code sends. In practice:

  1. Open your app’s settings on GitHub (Settings > Developer settings > OAuth Apps or GitHub Apps) and look for the new warning. Check every callback URL for a #.
  2. Add a real path for the callback, such as https://app.example.com/oauth/callback, and make your web server or hosting platform serve your app on that path. For a hash-routed single-page app this usually means one static page or rewrite rule that reads the code and state query parameters and then hands the user to the hash route.
  3. If you used the fragment to remember where to send the user after sign-in, store that location on your side before the redirect (in the session, or keyed by the state value you generate) instead of in the URL.
  4. Update the redirect_uri in your authorization request and in the token exchange: GitHub’s docs say it can use the redirect_uri sent with the token request to match the one the code was issued for.
  5. Test the full sign-in flow before February 1, 2027, and only then remove the old fragment URL from the app’s settings.

If you are new to how OAuth requests and tokens fit together, our older guide on making authenticated OAuth requests covers the basics.

What doesn’t change

Wildcard matching for callback URLs and loopback redirects for desktop apps (such as http://127.0.0.1:1234/path, where the port may differ from the registered one) are still described in the docs as before. The change only concerns the fragment. GitHub also continues to recommend the state parameter against cross-site request forgery and PKCE (code_challenge and code_verifier) to secure the flow, which are worth adding while you are editing the sign-in code anyway.

How it compares

GitHub is moving toward what the standard has said since 2012, the year RFC 6749 was published. It is not GitHub’s only early-2027 deadline: on December 1 GitHub also announced hard limits on users, teams and organizations per account from January 5, 2027.

Sources