weibeu / Flask-Discord

Discord OAuth2 extension for Flask. An Easier implementation of "Log In With Discord".
https://flask-discord.readthedocs.io/en/latest/
MIT License
183 stars 47 forks source link

Missing Acess Token parameter #60

Open popQA17 opened 2 years ago

popQA17 commented 2 years ago

I received this while using my app normally:

[2022-02-25 14:36:08,237] ERROR in app: Exception on /callback/ [GET]
Traceback (most recent call last):
  File "/home/runner/SomelistAPI/venv/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/runner/SomelistAPI/venv/lib/python3.8/site-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/runner/SomelistAPI/venv/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/runner/SomelistAPI/venv/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/runner/SomelistAPI/venv/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "main.py", line 74, in callback
    discord.callback()
  File "/home/runner/SomelistAPI/venv/lib/python3.8/site-packages/flask_discord/client.py", line 156, in callback
    token = self._fetch_token(state)
  File "/home/runner/SomelistAPI/venv/lib/python3.8/site-packages/flask_discord/_http.py", line 93, in _fetch_token
    return discord.fetch_token(
  File "/home/runner/SomelistAPI/venv/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 366, in fetch_token
    self._client.parse_request_body_response(r.text, scope=self.scope)
  File "/home/runner/SomelistAPI/venv/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 448, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "/home/runner/SomelistAPI/venv/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in parse_token_response
    validate_token_parameters(params)
  File "/home/runner/SomelistAPI/venv/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 451, in validate_token_parameters
    raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.

I can confirm that the token, client_id, and client_secrets are all valid and correct.

How do I solve this problem then?

vibOnTop commented 6 months ago

im having the same thing except im using flask-dance