This method will be depreciated; use the request_loader below instead.
By default the Authorization header's value is passed to your header_loader callback. You can change the header used with the AUTH_HEADER_NAME configuration.
Sometimes you want to login users without using cookies, such as using header values or an api key passed as a query argument. In these cases, you should use the request_loader callback. This callback should behave the same as your user_loader callback, except that it accepts the Flask request instead of a user_id.
By default, the LoginManager uses flash to display messages when a user is required to log in. These messages are in English. If you require localization, set the localize_callback attribute of LoginManager to a function to be called with these messages before they're sent to flash, e.g. gettext. This function will be called with the message and its return value will be sent to flash instead.
This sets the callback for loading a user from a header value. The function you set should take an authentication token and return a user object, or None if the user does not exist.
callback – The callback for retrieving a user object.
It can be convenient to globally turn off authentication when unit testing. To enable this, if either of the application configuration variables LOGIN_DISABLED or TESTING is set to True, this decorator will be ignored.
Behaves identically to the login_required() decorator with respect to configutation variables.