shashi278 / social-auth-kivy

Integrate Google, Facebook, Github & Twitter login in kivy applications
MIT License
150 stars 23 forks source link

Internal Error google login - desktop #11

Closed kulothunganug closed 3 years ago

kulothunganug commented 3 years ago

Describe the bug

When trying to login with Google using the demo application it opens the browser and when I selected the google account which I want to login it redirects to a page and gives error. The application didn't closes.

Expected behavior

Login succesfully without any kind of error.

Screenshots

error

Desktop (please complete the following information):

Logs

[INFO   ] [Logger      ] Record log in /home/kulothungan/.kivy/logs/kivy_21-03-28_4.txt
[INFO   ] [Kivy        ] v2.0.0
[INFO   ] [Kivy        ] Installed at "/home/kulothungan/.local/lib/python3.6/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.6.9 (default, Jan 26 2021, 15:33:00) 
[GCC 8.4.0]
[INFO   ] [Python      ] Interpreter at "/usr/bin/python3"
[INFO   ] [Logger      ] Purge log fired. Analysing...
[INFO   ] [Logger      ] Purge 5 log files
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [Factory     ] 186 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO   ] [KivyMD      ] 0.104.2.dev0, git-Unknown, 2021-03-26 (installed at "/home/kulothungan/.local/lib/python3.6/site-packages/kivymd/__init__.py")
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'3.0 Mesa 20.0.8'>
[INFO   ] [GL          ] OpenGL vendor <b'Intel Open Source Technology Center'>
[INFO   ] [GL          ] OpenGL renderer <b'Mesa DRI Intel(R) HD Graphics 2500 (IVB GT1)'>
[INFO   ] [GL          ] OpenGL parsed version: 3, 0
[INFO   ] [GL          ] Shading version <b'1.30'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <16>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [KivyAuth    ] 2.3.1 (installed at "/home/kulothungan/.local/lib/python3.6/site-packages/kivyauth/__init__.py")
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [ProbeSysfs  ] device match: /dev/input/event5
[INFO   ] [MTD         ] Read event from </dev/input/event5>
[INFO   ] [Base        ] Start application main loop
[WARNING] [MTD         ] Unable to open device "/dev/input/event5". Please ensure you have the appropriate permissions.
 * Serving Flask app "kivyauth.desktop.utils" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
  * Running on https://127.0.0.1:9004/ (Press CTRL+C to quit)
[3625:3625:0328/114811.508561:ERROR:broker_posix.cc(43)] Invalid node channel message
Opening in existing browser session.
[3615:3615:0100/000000.979367:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[3615:3615:0100/000000.979902:ERROR:broker_posix.cc(43)] Invalid node channel message
 127.0.0.1 - - [28/Mar/2021 11:48:12] "GET /loginGoogle HTTP/1.1" 302 -
 [2021-03-28 11:48:19,241] ERROR in app: Exception on /loginGoogle/callbackGoogle [GET]
 Traceback (most recent call last):
   File "/home/kulothungan/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
     response = self.full_dispatch_request()
   File "/home/kulothungan/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
     rv = self.handle_user_exception(e)
   File "/home/kulothungan/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
     reraise(exc_type, exc_value, tb)
   File "/home/kulothungan/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
     raise value
   File "/home/kulothungan/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
     rv = self.dispatch_request()
   File "/home/kulothungan/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
     return self.view_functions[rule.endpoint](**req.view_args)
   File "/home/kulothungan/.local/lib/python3.6/site-packages/kivyauth/desktop/google_auth.py", line 100, in callbackGoogle
     client_google.parse_request_body_response(json.dumps(token_response.json()))
   File "/home/kulothungan/.local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 421, in parse_request_body_response
     self.token = parse_token_response(body, scope=scope)
   File "/home/kulothungan/.local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 431, in parse_token_response
     validate_token_parameters(params)
   File "/home/kulothungan/.local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 438, in validate_token_parameters
     raise_from_error(params.get('error'), params)
   File "/home/kulothungan/.local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/errors.py", line 405, in raise_from_error
     raise cls(**kwargs)
 oauthlib.oauth2.rfc6749.errors.InvalidClientError: (invalid_client) Unauthorized
 127.0.0.1 - - [28/Mar/2021 11:48:19] "GET /loginGoogle/callbackGoogle?code=4%2F0AY0e-g43jydTL-tsV7IoVBsPucbC9kD01pINtEkq8y7wBWGNHeRKYXYeUg_RAw9qOF24tA&scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&authuser=0&prompt=consent HTTP/1.1" 500 -
shashi278 commented 3 years ago

That's because the client secret you used isn't valid. Make sure you've created OAuth apps for different providers you want to use and then use their client ID and secret in the demo application.

kulothunganug commented 3 years ago

I just used the demo client_id.

Did the demo's client_id (google) is expired?

alexladwong commented 1 year ago

I am facing the same issue. Should the second email address be a different mail?