:tocdepth: 3 :py:mod:`gws.base.auth.manager` =============================== .. py:module:: gws.base.auth.manager .. autoapi-nested-parse:: Authorization and session manager. **Source code:** :source:`gws.base.auth.manager` Module Contents --------------- .. py:class:: Config(*args, **kwargs) Bases: :py:obj:`gws.Config` Authentication and authorization options .. py:attribute:: methods :type: Optional[list[gws.ext.config.authMethod]] authorization methods .. py:attribute:: mfa :type: Optional[list[gws.ext.config.authMultiFactorAdapter]] authorization providers .. py:attribute:: providers :type: Optional[list[gws.ext.config.authProvider]] authorization providers .. py:attribute:: session :type: Optional[gws.ext.config.authSessionManager] session options .. py:class:: Object Bases: :py:obj:`gws.AuthManager` Authorization manager. .. py:method:: authenticate(method, credentials) Authenticate a user. :param method: Authentication method. :param credentials: Credentials object. :returns: An authenticated User or ``None`` if authentication failed. .. py:method:: configure() Configuration hook. .. py:method:: enter_middleware(req) Begin middleware processing. :param req: Requester object. :returns: A Responder object or ``None``. .. py:method:: exit_middleware(req, res) Finish middleware processing. :param req: Requester object. :param res: Current responder object. .. py:method:: get_method(uid=None, ext_type=None) Get an authentication Method by its uid. :param uid: Uid. :returns: A Method or ``None``. .. py:method:: get_mf_adapter(uid=None, ext_type=None) Get an authentication Provider by its uid. :param uid: Uid. :returns: A Provider or ``None``. .. py:method:: get_provider(uid) Get an authentication Provider by its uid. :param uid: Uid. :returns: A Provider or ``None``. .. py:method:: get_user(user_uid) Get a User by its global uid. :param user_uid: Global user uid. :returns: A User or ``None``. .. py:method:: serialize_user(user) Return a string representation of a User. :param user: A User object. :returns: A json string. .. py:method:: unserialize_user(data) Restore a User object from a serialized representation. :param ser: A json string. :returns: A User object.