Login

invenio_ext.login package

Provide initialization and configuration for flask_login module.

invenio_ext.login.authenticate(nickname_or_email=None, password=None, login_method=None, remember=False)

Find user identified by given information and login method.

Parameters:
  • nickname_or_email – User nickname or email address
  • password – Password used only in login methods that need it
  • login_method – Login method (default: ‘Local’)
Returns:

UserInfo

invenio_ext.login.login_redirect(referer=None)

Redirect to url after login.

invenio_ext.login.login_user(user, *args, **kwargs)

Allow login user by its id.

invenio_ext.login.setup_app(app)

Setup login extension.

Submodules

invenio_ext.login.legacy_user module

Provide support for legacy UserInfo object.

class invenio_ext.login.legacy_user.UserInfo(uid=None, force=False)

Bases: werkzeug.datastructures.CombinedMultiDict, flask_login.UserMixin

Provide legacy implementation.

Methods that Flask-Login and Invenio 1.x expect user objects to have.

get_acc_key()

Generate key for caching authorizations.

get_id()

Get user id.

get_key()

Generate key for caching user information.

is_active()

Check if user is active.

is_admin

Check if user is admin.

is_authenticated()

Check if user is authenticated.

is_authorized(name, **kwargs)

Check if user is authorized.

is_confirmed()

Return true if accounts has been confirmed.

is_guest

Check if user is guest.

is_super_admin

Check if user is super admin.

reload()

Reload user login information and saves them.

save()

Save modified data permanently for logged users.

update_request_info()

Update request information.