Ayush Singh
Ayush Singh

Reputation: 13

how to fix google OAuth2 error?

the error shows are

The JavaScript origin in the request, http://localhost, does not match the ones authorized for the OAuth client. Visit https://console.developers.google.com/apis/credentials/oauthclient/MY_CLIENT_ID?project=810656699155 to update the authorized JavaScript origins.

Upvotes: 0

Views: 3924

Answers (1)

Larce
Larce

Reputation: 851

The problem is your configuration in the google developer console. You need to specify a whitelist of JavaScript origins, which are allowed to access the OAuth end point. You should be able to add localhost to this whitelist, und the link showed in the google developers OAuth settings.

For security reasons, you should not activate this in a production environment, because you do not want to run the OAuth process locally on your machine. But this is completly fine in development environment.

Upvotes: 1

Related Questions