When I was trying to run the application I had faced this problem. It was resolved by setting authorize redirect URLs in a proper manner.
- Go to google cloud platform , from the sidebar, click API Manager and select Credentials and then select OAuth consent screen.
- You need to add new client id for web application.
Do not give the path like this http://localhost:8228/projectpathit will throw the above error (invalid_client no registered origin).