Google OAuth 2.0 Not login in Live, Callback URL error 404 Not Found [closed]

I’m working on Google Analytics read-only access API.
I brought Google Analytics Data API, fully setup the initial user type internal because its organization.
Have API key, Client ID, and Client Secret. It prefectly work when in localhost login with OAuth 2.0 and gets access token to get Analytics data but After I live in AWS and I try Login, callback throw the error 404 Not found.

enter code here[enter image description here][1]
enter code here[enter image description here][2]
enter code here[enter image description here][3]
enter code here[enter image description here][4]

Local host Login work and what the problem in the live server, I could not find where is the problem

enter code here [1]: https://i.stack.imgur.com/9RGfj.png
enter code here[2]: https://i.stack.imgur.com/BlaMr.png
enter code here[3]: https://i.stack.imgur.com/OO26y.png
enter code here[4]: https://i.stack.imgur.com/htar1.png

  • 1

    Well we can’t find the problem either if you don’t share your code. -> Minimal, Reproducible Example

    – 

  • i.stack.imgur.com/htar1.png – that second request there shows that this already properly “returned” from the Google auth screen, to your application. Your application itself then decides to issue a 301 redirect from /callback to /callback/, and that URL then gets a 404 response. So you need to go and figure out why your system misbehaves that way here.

    – 




  • I’m doing frontend in React.js and connect with OAuth 2.0 client-side for accessing readonly from Google Analytics Data API. Frontend code everything works on localhost:3000,When i click on Login google,it will redirect to /auth.google and get access token pass to Analytics API to get datas. After i live into AWS server,Frontend website, when i click on Login Google and its redirect to auth.google but callback throw 404 error . I cant find where was the problem. , just look the Images on the question @Reyno

    – 




  • Is it problem with my code or I have to change any settings in OAuth configur system means, can you explain detail ,where i can check @CBroe

    – 




  • Wait, are you saying that you are trying to handle all of this in front-end side code, without any server-side component? Then this is the wrong approach to begin with! Exchanging the code parameter for a token requires an API call – and that API call needs your client secret as one of the parameters. And that is named client secret for good reason, because you need to keep it secret – which you won’t be doing, if you implemented this API call in client-side code …

    – 




Leave a Comment