1

I am trying to pass audience as a parameter in flask jwt extended for decoding jwt token, My code is like this,

@app.route('/api')
@jwt_required
def my_api():
    return json.dumps('Welcome ')

when i call my api i am getting

{
    "msg": "Invalid audience"
}

I know, we have to provide audience value. However i am not sure how to pass audience in jwt_required in flask_jwt_extended. Can someone help me?

Dimitri Bosteels
  • 381
  • 4
  • 12
backtrack
  • 7,996
  • 5
  • 52
  • 99

1 Answers1

0

Flask-JWT-Extended is very opinionated about that claims need to be in a token for all of the extra features to work. If you are getting your JWTs from a different provider, chances are very high that you should be using Flask-JWT-Simple instead. You can view some discussions about it here: https://github.com/vimalloc/flask-jwt-extended/issues/85

vimalloc
  • 3,869
  • 4
  • 32
  • 45