AWS Congito "redirect_mismatch"

Hi

I’m using the cognito-implicit-example example from github, to login via cognito.

My problem was similar to the this guy’s here. Redirect_mismatch error for AWS Cognito

I added the urls, but still I see this error. Given the post is old, has there been any changes in the redirect urls for cognito?

Allowed callback URLs
http://localhost:3000/callback
https://auth.web3auth.io/auth
https://d84l1y8p4kdic.cloudfront.net
https://testing.openlogin.com/auth
Allowed sign-out URLs
http://localhost:3000
https://auth.web3auth.io/auth
https://testing.openlogin.com/auth

Thanks for sharing the details, Aniket! Here’s a summary of your issue and what the support team will need to assist further:


Issue Summary


Additional Details Needed

To help you further, could you please provide:

  1. Web3Auth SDK Version you are using (if not latest).
  2. The exact URL shown in the browser’s address bar when the error occurs (sometimes the redirect URI in the URL can reveal mismatches).
  3. Relevant code snippet of your Web3Auth initialization and login (especially the redirectUrl or any custom parameters passed).
  4. Screenshot of the error (optional, but can help confirm the exact mismatch).

Quick Suggestions & Documentation

  • Ensure the Redirect URI matches exactly:
    AWS Cognito is very strict about redirect URIs. Even a missing slash or protocol difference can cause a mismatch. Double-check that the URI you pass to Cognito during the OAuth flow (from your Web3Auth config) matches one of the allowed callback URLs in Cognito exactly.
  • Check the redirectUrl used in your Web3Auth config:
    In the Web3Auth Cognito Example, the redirect URI is usually set as http://localhost:3000/callback for local development.
    Ensure that this is what’s being sent in the OAuth request.
  • Recent changes:
    There have not been recent changes to the required redirect URLs for Cognito in the Web3Auth docs, but always ensure your URLs match what is being sent in the actual request.

Reference:


Next Steps:
Please reply with the requested details (especially the SDK version and the actual redirect URI in the error) so we can help you debug this quickly!

Let us know if you have any other context or logs to share.

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours