OAuth

Fix OAuth Redirect URI Mismatch Error

Updated April 2026

Reading this article? Verify your fix in real-time. Debug your OAuth error โ€” OAuthFixer โ†’

The redirect_uri in your OAuth request must exactly match the URI registered in your provider dashboard โ€” character for character, including protocol, port, and trailing slash. One difference causes the error.

OAuth Error Response
{"error": "redirect_uri_mismatch", "error_description": "The redirect_uri does not match the registered redirect URIs"}

Common mismatches

What you sentWhat you registeredProblem
http://localhost:3000http://localhost:3000/Trailing slash missing
https://app.example.comhttp://app.example.comProtocol mismatch
https://www.example.com/callbackhttps://example.com/callbackwww prefix mismatch
https://app.example.com/callback?session=1https://app.example.com/callbackQuery string not allowed
https://app.example.com:3000/callbackhttps://app.example.com/callbackPort in URI not registered

How to find your registered URIs per provider

Auth0

Dashboard โ†’ Applications โ†’ Your App โ†’ Settings โ†’ Allowed Callback URLs

Google

Google Cloud Console โ†’ APIs & Services โ†’ Credentials โ†’ OAuth Client โ†’ Authorized redirect URIs

Okta

Okta Admin โ†’ Applications โ†’ Your App โ†’ General โ†’ Login redirect URIs

AWS Cognito

Cognito Console โ†’ User Pools โ†’ Your Pool โ†’ App clients โ†’ App client settings โ†’ Callback URL(s)

Fix โ€” match exactly, then add all environments

// In your code โ€” log what you are actually sending
const redirectUri = 'https://app.example.com/callback';
console.log('redirect_uri:', redirectUri);

// Build auth URL
const params = new URLSearchParams({ client_id: 'your-client-id', redirect_uri: redirectUri, // must match registered exactly response_type: 'code', scope: 'openid profile email',
});
window.location.href = `https://auth.example.com/oauth/authorize?${params}`;

Register all environments you use โ€” development, staging, and production โ€” in the provider dashboard. There is no limit on the number of registered URIs for most providers.

Debug your OAuth error live โ†’ OAuthFixer