diff --git a/authlib/integrations/flask_client/apps.py b/authlib/integrations/flask_client/apps.py index 7567f4b3..84ac8c0d 100644 --- a/authlib/integrations/flask_client/apps.py +++ b/authlib/integrations/flask_client/apps.py @@ -85,12 +85,12 @@ def authorize_access_token(self, **kwargs): raise OAuthError(error=error, description=description) params = { - 'code': request.args['code'], + 'code': request.args.get('code'), 'state': request.args.get('state'), } else: params = { - 'code': request.form['code'], + 'code': request.form.get('code'), 'state': request.form.get('state'), }