Skip to content

Web development

Do GitHub OAuth callback URLs with a # fragment stop working in 2027?

GitHub says it will reject OAuth authorization requests with redirect URIs containing URL fragments from February 1, 2027. What the change covers and how to check an app.

By Nadir AMMI SAID 4 min read

The short answer

Yes, if your app is on github.com and its callback URL contains a # fragment. GitHub says that starting February 1, 2027 it will reject OAuth authorization requests that use a redirect URI containing a URL fragment. After enforcement, GitHub says developers will no longer be able to register or use such a redirect URI.

    Who is affected

    GitHub says the change affects GitHub Apps and OAuth apps that register a callback URL containing a # fragment. It also says the change applies to github.com on the Free, Team, and Enterprise Cloud plans, and does not apply to GitHub Enterprise Server.

    A URL fragment is the part of a URL after the # character. For example, a hypothetical callback registered as an address ending in /app#/auth/callback carries the fragment /auth/callback. Single-page apps with hash-based routing are one place I would expect to find this pattern, though GitHub does not say so.

      Why GitHub is making the change

      GitHub gives two reasons. It says redirect URIs with fragments are not part of the OAuth 2.0 specification (it cites RFC 6749 section 3.1.2.3), and it says they introduce a security risk because a fragment can be used to intercept an authorization code or token during a redirect.

        What GitHub says to do now

        GitHub advises removing the fragment from the app's callback URL now to avoid disruption. Until the deadline, GitHub says a warning appears in the app's settings and a caution message is shown to users who sign in through the app.

        The post gives no description of how an app should restructure its routing after removing the fragment.

          How I would check an app

          I would start with the registered callback URL of each GitHub App and OAuth app I run on github.com, looking for a # character. The settings warning GitHub describes is a second signal, though I would not rely on it alone.

          Then I would look at the code that builds the authorization request, since GitHub's rule covers the redirect URI used in requests as well as the registered one. If a fragment is there, I would move the part after the # into a path or a query parameter on the app's own side, and handle that value after the callback completes. That is my own approach, not GitHub's instruction.

          To verify, I would complete a full sign-in with the new callback URL registered and confirm the user lands where the old flow sent them. The limitation is that this only shows the new URL works today; GitHub's rejection of fragments starts on the stated date.

            Technologies mentioned

            • GitHub Apps
            • OAuth apps
            • OAuth 2.0

            Sources

            Keep reading

            On the same topics.