0

I need to create and return a token like this :

@app.route('/account/login', methods=['POST'])
def login():
    if user:
        ...

        return authorization.create_token_response(request={
                'client_id': '',
                'client_secret': '',
                'grant_type': 'password',
                'username': '',
                'password': ''
            })
    else:
        ...

But I don't know how to build the request object which create token response receives. Can you help me, please ?

Obs : I need to filter the input data, I don't want to use /oauth/token as you can see here

Luis Souza
  • 365
  • 1
  • 3
  • 11

1 Answers1

1

This use case is very weird. If you just want to generate a request object. You can create it using the class OAuth2Request, which you can find at:

from authlib.specs.rfc6749 import OAuth2Request
lepture
  • 2,307
  • 16
  • 18