dheerajrajjak / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
0 stars 0 forks source link

URL given by moderator.py --noauth_local_webserver doesn't work #132

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

I am trying to setup oauth2 for a "device", but struggle to run the demo. The 
URL is not correctly processed by the web server.

What steps will reproduce the problem?
1. run "python2 moderator.py --noauth_local_webserver"
2. go to the URL given with your browser

What is the expected output? What do you see instead?

The URL given 
(https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.co
m%2Fauth%2Fmoderator&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_t
ype=code&client_id=433807057907.apps.googleusercontent.com&access_type=offline)
returns an error:

"400 Bad Request"
Erreur :redirect_uri_mismatch

The redirect URI in the request: urn:ietf:wg:oauth:2.0:oob did not match a 
registered redirect URI

En savoir plus
Détails de la requête

    from_login=1
    scope=https://www.googleapis.com/auth/moderator
    response_type=code
    access_type=offline
    redirect_uri=urn:ietf:wg:oauth:2.0:oob
    approval_prompt=auto
    as=-1bf59d92ec619c94
    pli=1
    client_id=433807057907.apps.googleusercontent.com
    hl=fr

What version of the product are you using? On what operating system?

version 1.0beta8 from archlinux

Thanks in advance, best regards.

Original issue reported on code.google.com by philf...@gmail.com on 29 Apr 2012 at 9:04

GoogleCodeExporter commented 8 years ago
This is the important part:

"""
Erreur :redirect_uri_mismatch
"""

When you set up the Project in the APIs Console you need to create
a Client ID for an installed application:

  * Installed application
    Runs on a desktop computer or handheld device (like Android or iPhone).

Then use that client id and client secret in the moderator sample.

Original comment by jcgregorio@google.com on 30 Apr 2012 at 12:41

GoogleCodeExporter commented 8 years ago
Closing for now, please reopen if this doesn't resolve the issue.

Original comment by jcgregorio@google.com on 30 Apr 2012 at 3:33

GoogleCodeExporter commented 8 years ago
Hello Joe,

Thanks for your answer.
I have created my own client ID for an "installed application", and used it in 
the moderator example. The URL given now works as expected, using the 
--noauth_local_webserver, and I can authenticate with success.

Best regards

Original comment by philf...@gmail.com on 1 May 2012 at 2:09

GoogleCodeExporter commented 8 years ago
Glad to hear you are up and running!

Original comment by jcgregorio@google.com on 1 May 2012 at 2:11