Search code examples
angulargoogle-oauthgoogle-api-nodejs-clientgoogle-api-js-client

Google API with angular2 Error:400


I am following this example https://stackoverflow.com/a/39770500/2983051 but unfortunately I am getting:

  1. That’s an error. Error: invalid_request Permission denied to generate login hint for target domain.

I am running angular2 app locally, in my gapi credentials Authorised JavaScript origins and Authorised redirect URIs are http://127.0.0.1:4200

Any ideas how to fix it? maybe good links for using angular2 + nodejs with google oauth2.


Solution

  • I've found the solution. Good example is here

    I was defining the Authorized redirect URI, but for JavaScript API it should stay undefined. enter image description here