0

I am trying to do Google API authorization through both Web Application approach and service account approach. For web application approach, the quick start code from their website works fine. However when I tried the same code with service account Client ID (same code as the quick start example, just replacing the Client ID), it gives me Invalid_client no registered origin error.

I saw in this post and other SO questions, mostly they forgot to put the Authorized Javascript Origin. However, this is different for service account approach, they don't have this field.

Anyone encountered same issue?

Error message: no registered origin

Request Details proxy=oauth2relay1086088613
immediate=false
scope=https://www.googleapis.com/auth/analytics.readonly
origin=https://localhost:9443
response_type=token
redirect_uri=postmessage
state=909080772|0.2369183797
client_id=113356969233986791514
include_granted_scopes=true

Community
  • 1
  • 1
blenzcoffee
  • 851
  • 1
  • 11
  • 35

1 Answers1

0

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.

Patrick
  • 476
  • 3
  • 3