gws.base.auth.provider

Source code: gws.base.auth.provider

Module Contents

class gws.base.auth.provider.Config(*args, **kwargs)

Bases: gws.Config

Auth provider config.

allowedMethods: list[str] | None

allowed authorization methods

class gws.base.auth.provider.Object

Bases: gws.AuthProvider

Authentication Provider.

authenticate(method, credentials)

Authenticate a user.

Parameters:
  • method – Authentication method.

  • credentials – Credentials object.

Returns:

An authenticated User or None if authentication failed.

configure()

Configuration hook.

serialize_user(user)

Return a string representation of a User.

Parameters:

user – A User object.

Returns:

A json string.

unserialize_user(data)

Restore a User object from a serialized representation.

Parameters:

ser – A json string.

Returns:

A User object.