8

i need to request google analytics readonly api

but i have some troubles :

Erro:invalid_client
 no registered origin
Detalhes da solicitação
scope=https://www.googleapis.com/auth/analytics.readonly
response_type=token
access_type=online
redirect_uri=postmessage
proxy=oauth2relay906123469
origin=https://bob.tricae.com.br/
state=450098374
display=page
prompt=none

my cliend_id is correct i get it from:

google.com/apis/console/#project

someone can help me with that?

Kara
  • 6,115
  • 16
  • 50
  • 57
Markomafs
  • 546
  • 4
  • 19

2 Answers2

7

In my experience, you have to create a web application client ID. For example, if I create a "service" client ID, there isn't any place to put "Authorized JavaScript Origins," but if I create a new "web application" client ID under my project, then it has a place for that. Once I created the client ID that way, then it accepted it.

Nickadoo
  • 104
  • 2
  • 7
3

Pretty sure you need to go to https://code.google.com/apis/console/ and add your page (the url at https://bob.tricae.com.br/ ) 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).

Rob Russell
  • 462
  • 3
  • 14