gws.base.auth.provider¶
Base authentication provider.
Source code: gws.base.auth.provider
Module Contents¶
- class gws.base.auth.provider.Config(*args, **kwargs)¶
Bases:
gws.ConfigAuth provider config.
- class gws.base.auth.provider.Object¶
Bases:
gws.AuthProviderBase authentication provider.
Reads the
allowedMethodsoption and serializes users as JSON of all their fields, roles, attributes and data. Subclasses implement authentication and user lookup; the defaultauthenticatereturns no user.- 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.
- 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.