Error: invalid_client no registered origin

3 Answers

UPDATE: I changed accepted answer to Johno Scott instead as he refers to the newer version of the console, whereas mine was only true for the older version.

I solved it. I needed to enter a WEB ORIGIN on the OAuth 2.0 Client ID screen. Specifically, it had to be the exact path/url of the index.html file, otherwise it defaults to the root domain which doesn't work.

This screenshot shows you exactly where it needs to be entered:

I have installed the Google Drive Realtime API sample files on my web server, following these instructions, including generating a client_id in the Cloud Console and inserting it into the index.html file.

When I visit that page and click the button to authorize the app, it pops up with a new window and shows:

Error: invalid_client
no registered origin

The Request Details are:


I can't see any other client_id that I should be using in the Cloud Console. Does anybody know how to overcome this error? Thanks for your help.

Pretty sure you need to go to and add your page (the url at ) to the client ID on the API Access tab. Click Edit Settings... on the right hand side then fill it in under "Authorized JavaScript Origins" (assuming you're using the Javascript client library).

invalid_client no registered origin for service account approach

Service accounts are typically used in server-to-server communication. You can think of a service account as a robot user that has permissions to access the API. Unless you're doing domain-wide delegation (where a service account can act on behalf of all users on a domain), you probably just want to use OAuth. Perhaps try the credentials wizard and see what it recommends?

If you do end up wanting to use service accounts, you'll need to download a private key for the service account and sign the request with that key (rather than just including the OAuth client ID). To do that, I recommend using one of the Google API Client Libraries.