Module Expr Str ImportFrom alias alias ImportFrom alias alias alias ImportFrom alias alias ImportFrom alias identifier Assign NameStore Call NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str keyword Num Assign NameStore Call NameLoad Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Dict Str Str Call NameLoad Str Call NameLoad Str For NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Dict Str NameLoad Print Call AttributeLoad Str attr NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad If CompareIn NameLoad NameLoad body If Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Return NameLoad Return NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Return NameLoad If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Return NameLoad Return NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args defaults body Return BinOpMod Str AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr
N/A N/A Multiple authentication example

This example demonstrates how to combine two authentication methods using the
"MultiAuth" class.

The root URL for this application can be accessed via basic auth, providing
username and password, or via token auth, providing a bearer JWT token.
 flask Flask g flask_httpauth HTTPBasicAuth HTTPTokenAuth MultiAuth werkzeug.security generate_password_hash check_password_hash itsdangerous TimedJSONWebSignatureSerializer JWT N/A app N/A Flask __name__ N/A N/A N/A app config N/A SECRET_KEY top secret! N/A jwt N/A JWT N/A N/A app config N/A SECRET_KEY expires_in 3600 N/A basic_auth N/A HTTPBasicAuth N/A token_auth N/A HTTPTokenAuth Bearer N/A multi_auth N/A MultiAuth basic_auth token_auth N/A users N/A john susan N/A generate_password_hash hello N/A generate_password_hash bye N/A user N/A N/A users keys N/A N/A token N/A N/A jwt dumps N/A username user N/A N/A N/A *** token for {}: {}
 format user token verify_password N/A N/A username password N/A N/A N/A N/A g user None N/A N/A username users N/A N/A N/A check_password_hash N/A N/A users get username password N/A N/A N/A g user username N/A True N/A False N/A N/A basic_auth verify_password verify_token N/A N/A token N/A N/A N/A N/A g user None N/A N/A N/A data N/A N/A jwt loads token N/A N/A N/A N/A False N/A N/A username data N/A N/A N/A g user N/A data N/A username N/A True N/A False N/A N/A token_auth verify_token index N/A N/A N/A N/A N/A N/A Hello, %s! N/A g user N/A N/A N/A app route / N/A multi_auth login_required N/A N/A __name__ __main__ N/A N/A N/A N/A app run