gws.base.auth.system_provider¶
Built-in provider of the guest and system users.
Source code: gws.base.auth.system_provider
Module Contents¶
- class gws.base.auth.system_provider.Object¶
Bases:
gws.AuthProviderSystem authentication provider.
Provides the
guestuser (rolesguestandall) and thesystemuser, which is allowed everything. Neither of them can log in.- type = 'system'¶
Provider type.
- users: dict¶
The guest and system users, keyed by
guestandsystem.
- authenticate(method, credentials)¶
Authenticate a user.
- Parameters:
method – The authentication method.
credentials – The credentials, for example
usernameandpassword.
- Returns:
The user, or
Noneif the provider does not know the user.- Raises:
AuthenticationError – If the credentials are wrong or match more than one user.
- configure()¶
Configuration hook.
Called when the node is initialized. Raising an exception here aborts the creation of the node.
- get_user(local_uid)¶
Get a user by its local uid.
- Parameters:
local_uid – User uid within the provider.
- Returns:
The user, or
Noneif not found.
- serialize_user(user)¶
Serialize a user to a string.
- Parameters:
user – The user.
- Returns:
The serialized user.
- unserialize_user(data)¶
Restore a user serialized by
serialize_user.- Parameters:
ser – The serialized user.
- Returns:
The user, or
Noneif it cannot be restored.