Hi there @swami,
Welcome to the community!
Being able to run this locally, but not on your test environment, suggests a missing configuration in your test environment’s web server.
SPAs require routing rules when hosting prod builds on a web server. You’ll see the same 404 error on any deep routes, not just in the authentication callback. Dev servers normally handle the routing rules for us, so it’s not something we see during local development.
Check out the resources provided in this response. Your solution depends on your specific web server and environment.
Happy coding!