1

I have Authorization server and Resource server... When the client sends a request to the Resource server, my Resource server must send a request to the Authorization server to verify token that it's still valid.
But how to verify it using Authlib? I couldn't find sample in their documentation...
In short I need a something like below:

server = AuthorizationServer(app, query_client=query_client, save_token=save_token)

@bp.route('/oauth/token', methods=['POST'])
def issue_token():
    return server.create_token_response()


@bp.route('/oauth/verify', methods=['POST'])
def verify_token():
    return server.create_verify_response()


@bp.route('/oauth/revoke', methods=['POST'])
def revoke_token():
    return server.create_endpoint_response('revocation')

On post request:

curl -X POST --user {res_ser_id}:{res_ser_secret} -d "client_id={res_ser_id}&client_secret={res_ser_secret}&access_token={access_token}&state={state}" http://127.0.0.1:5000/oauth/verify

How to realize a something like this route?

P.S. For me acceptable any variant, just now I don't know totally how to verify token.

Denis Sologub
  • 7,277
  • 11
  • 56
  • 123
  • 1
    Is the oauth protocol a requirement for your project? flask-jwt-extended might be a better simpler fit. – SargeATM Sep 29 '18 at 21:17
  • @SargeATM, it is not direct solution of my problem but I understood from this that I can just request any route that requires `access_token` and if the HTTP status is 200 then all is okey. It sounds logically, I don't know why I couldn't get it before. – Denis Sologub Sep 29 '18 at 22:43
  • @Шах were you able to come up with a solution? – Michael Dec 28 '19 at 19:23

0 Answers0