Google has an OAuth2 client example here
I am completely new to OAuth2, and I would like this example to work before I switch to OAuth2 integration with my application. I have done the following:
- Register a test application
- Get client id and client privacy
- Set these values ββin client_secrets.json
- Run the test application:
python moderator.py
The application opens a browser where I can (as a user) allow the application access to my account. But Google complains so much (400 Bad Request):
Error: redirect_uri_mismatch The redirect URI in the request: http://localhost:8080/ did not match a registered redirect URI Learn more Request Details from_login=1 scope=https://www.googleapis.com/auth/moderator response_type=code access_type=offline redirect_uri=http://localhost:8080/ approval_prompt=auto as=-xxxxxxxxxxxxx pli=1 client_id=xxxxxxxxxxx.apps.googleusercontent.com authuser=0 hl=en
I assume that localhost: 8080 comes from an internal web server running moderator.py. My question is: did anyone get this example to work? What other components do I need (apache configuration, DNS, ...)
I am very confused about OAuth2 and any help would be greatly appreciated.
dangonfast
source share