phacility/phabricator · error · Exception

OAuth application redirect URIs must only use the "http" or

Error message

OAuth application redirect URIs must only use the "http" or "https" protocols, but the URI "%s" uses the "%s" protocol.

What it means

Error "OAuth application redirect URIs must only use the "http" or "https" protocols, but the URI "%s" uses the "%s" protocol." thrown in phacility/phabricator.

Source

Thrown at src/applications/oauthserver/PhabricatorOAuthServer.php:219

    $uri = new PhutilURI($raw_uri);

    $fragment = $uri->getFragment();
    if (strlen($fragment)) {
      throw new Exception(
        pht(
          'OAuth application redirect URIs must not contain URI '.
          'fragments, but the URI "%s" has a fragment ("%s").',
          $raw_uri,
          $fragment));
    }

    $protocol = $uri->getProtocol();
    switch ($protocol) {
      case 'http':
      case 'https':
        break;
      default:
        throw new Exception(
          pht(
            'OAuth application redirect URIs must only use the "http" or '.
            '"https" protocols, but the URI "%s" uses the "%s" protocol.',
            $raw_uri,
            $protocol));
    }
  }

  /**
   * If there's a URI specified in an OAuth request, it must be validated in
   * its own right. Further, it must have the same domain, the same path, the
   * same port, and (at least) the same query parameters as the primary URI.
   */
  public function validateSecondaryRedirectURI(
    PhutilURI $secondary_uri,
    PhutilURI $primary_uri) {

    // The secondary URI must be valid.

View on GitHub (pinned to 5720a38cfe)

When it happens

Trigger: Thrown at src/applications/oauthserver/PhabricatorOAuthServer.php:219 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/520aa45791ac7801. Report an issue: GitHub.