def authn_and_authz(): """All-in-one convenience function for implementing the basic abaco authentication and authorization on a flask app. Use as follows: import auth my_app = Flask(__name__) @my_app.before_request def authnz_for_my_app(): auth.authn_and_authz() """ # we use the agaveflask authn_and_authz function, passing in our authorization callback. agaveflask_az(authorization)
def authn_and_authz(): """All-in-one convenience function for implementing the basic abaco authentication and authorization on a flask app. Use as follows: import auth my_app = Flask(__name__) @my_app.before_request def authnz_for_my_app(): auth.authn_and_authz() """ accept_nonce = Config.get('web', 'accept_nonce') if accept_nonce: agaveflask_az(check_nonce, authorization) else: # we use the agaveflask authn_and_authz function, passing in our authorization callback. agaveflask_az(authorization)