shashi278 / social-auth-kivy

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

google auth failed when using demo code #20

Closed ghost closed 1 year ago

ghost commented 2 years ago

Describe the bug I'm trying to text the package using the demo code first when I press the google button its opens the google auth page in browser but when I choose an email its loads other page with an error as in the images below

To Reproduce Steps to reproduce the behavior:

  1. run the demo code
  2. Click on sign in with google button

Screenshots Web capture_12-4-2022_15335_127 0 0 1

Desktop (please complete the following information):

Additional context this the log in my terminal

  * Running on https://127.0.0.1:9004 (Press CTRL+C to quit)
 * 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
 127.0.0.1 - - [12/Apr/2022 01:53:13] "GET /loginGoogle HTTP/1.1" 302 -
 [2022-04-12 01:53:17,331] ERROR in app: Exception on /loginGoogle/callbackGoogle [GET]
 Traceback (most recent call last):
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\flask\app.py", line 2077, in wsgi_app
     response = self.full_dispatch_request()
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\flask\app.py", line 1525, in full_dispatch_request
     rv = self.handle_user_exception(e)
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\flask\app.py", line 1523, in full_dispatch_request
     rv = self.dispatch_request()
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\flask\app.py", line 1509, in dispatch_request
     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\kivyauth\desktop\google_auth.py", line 100, in callbackGoogle
     client_google.parse_request_body_response(json.dumps(token_response.json()))
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\oauthlib\oauth2\rfc6749\clients\base.py", line 448, in parse_request_body_response
     self.token = parse_token_response(body, scope=scope)
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\oauthlib\oauth2\rfc6749\parameters.py", line 441, in parse_token_response
     validate_token_parameters(params)
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\oauthlib\oauth2\rfc6749\parameters.py", line 448, in validate_token_parameters
     raise_from_error(params.get('error'), params)
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\oauthlib\oauth2\rfc6749\errors.py", line 399, in raise_from_error
     raise cls(**kwargs)
 oauthlib.oauth2.rfc6749.errors.InvalidClientError: (invalid_client) Unauthorized
 127.0.0.1 - - [12/Apr/2022 01:53:17] "GET /loginGoogle/callbackGoogle?code=4%2F0AX4XfWgjTrEw84IGIrtZb16k69MCznMjpoF4AO1VGNZc3raOue1IJ56pWzDkOda3kVCU1w&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 -
 C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\urllib3\connectionpool.py:1043: InsecureRequestWarning: Unverified HTTPS request is being made to host '127.0.0.1'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
   warnings.warn(
 [2022-04-12 01:54:28,997] ERROR in app: Exception on /kill3274 [GET]
 Traceback (most recent call last):
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\flask\app.py", line 2077, in wsgi_app
     response = self.full_dispatch_request()
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\flask\app.py", line 1525, in full_dispatch_request
     rv = self.handle_user_exception(e)
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\flask\app.py", line 1523, in full_dispatch_request
     rv = self.dispatch_request()
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\flask\app.py", line 1509, in dispatch_request
     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
   File "C:\Users\username\PycharmProjects\kivy-social-auth\venv\lib\site-packages\kivyauth\desktop\utils.py", line 45, in close_server
     raise RuntimeError("Not running with the Werkzeug Server")
 RuntimeError: Not running with the Werkzeug Server
 127.0.0.1 - - [12/Apr/2022 01:54:28] "GET /kill3274 HTTP/1.1" 500 -
shashi278 commented 2 years ago

Hi @hussam132 , seems like Werkzeug is not installed. Can you try pip3 install werkzeug and check if error persists?

ghost commented 2 years ago

hi @shashi278 thank you for quick reply I Tried to install it and it already there Requirement already satisfied: werkzeug in c:\users\user\pycharmprojects\kivy-social-auth\venv\lib\site-packages (2.1.1)

shashi278 commented 2 years ago

Hi @coderuser01, I didn't get time to look into it yet. Were you able to resolve this? Do you want me to take a closer look at it?

ghost commented 2 years ago

@shashi278 no actually I don't solved yet

shashi278 commented 1 year ago

@ghost It's been fixed in the latest release 2.3.3.