OAuth callback fails or returns to the wrong URL
OAuth callback fails or returns to the wrong URL
If the OAuth flow completes on the provider side but the user lands on the wrong page — or the callback request fails with a redirect URI error — every part of the redirect URI must match the registered value exactly.Check each of these in order:
redirect_uriin the authorization URL — the value your app appends to the authorization request URL must be present and correctly encoded.- Callback URL stored on the OAuth app — the value registered in your Pxxl OAuth application settings must be identical to what your app sends at runtime.
- Redirect URI allowlist — the provider will reject any
redirect_urithat is not on the approved list for the OAuth application. - HTTPS — the callback URL must use
https://in production. Many OAuth providers refuse plaintext HTTP callback URLs. - Trailing slash —
https://example.com/callbackandhttps://example.com/callback/are treated as different URLs by most OAuth providers. Check both the registered value and the sent value for a trailing slash mismatch.
For the full OAuth integration setup guide — including how to register callback URLs and configure scopes — see the OAuth Integrations documentation.
Bad verification code error
Bad verification code error
A
bad_verification_code or equivalent error during token exchange means the authorization code your backend sent to the token endpoint was expired, already used, or mismatched with the original authorization request.What causes itAuthorization codes are short-lived (typically 60 seconds or less) and single-use. The code becomes invalid as soon as any of these happen:- It expires before your backend exchanges it.
- It has already been used once — even if the exchange returned an error the first time.
- The user refreshed the callback page, causing the browser to re-submit a code that was already consumed.
- The
redirect_urisent to the token endpoint does not match the one sent during the original authorization request.
- Do not exchange the code from browser JavaScript. Client-side code is visible to anyone who inspects the page. Always exchange authorization codes from your backend server.
- Do not retry the same code after a failed exchange. Once a code has been submitted — even unsuccessfully — treat it as consumed and restart the authorization flow.
- Do not reuse a code after a page refresh. If the callback URL is re-visited or the page is refreshed, the code in the URL is stale. Redirect the user back to the authorization endpoint to get a new one.
- Do not use a different
redirect_uriduring token exchange. Theredirect_uriparameter in your token request must be identical to the one used in the original authorization URL, even though no actual redirect happens at this stage.
Authorization redirects back with invalid_redirect_uri
Authorization redirects back with invalid_redirect_uri
