gws.plugin.qfieldcloud.auth¶
Token authorization method for QField clients.
Source code: gws.plugin.qfieldcloud.auth
Module Contents¶
- class gws.plugin.qfieldcloud.auth.Config¶
Bases:
gws.base.auth.method.ConfigToken authentication for QField clients.
- class gws.plugin.qfieldcloud.auth.Object¶
Bases:
gws.base.auth.method.ObjectQField Cloud authorization method.
Token authorization for QField clients. The
qfieldcloudaction creates sessions with this method on login and accepts only tokens of its sessions.- authenticate_from_credentials(credentials: gws.Data, req: gws.WebRequester) Result¶
Authenticate a user by username and password and create a session.
- Parameters:
credentials – Data with
usernameandpassword.req – Web request.
- Returns:
Authentication result with the new session and its expiry time.
- Raises:
gws.AuthenticationError – If the credentials are invalid.
- authenticate_from_token(req: gws.WebRequester) Result¶
Authenticate a request by the
Authorization: Token ...header and touch the session.- Parameters:
req – Web request.
- Returns:
Authentication result with the existing session and its new expiry time.
- Raises:
gws.AuthenticationError – If the header is missing, or the token is invalid or belongs to another method.
gws.ForbiddenError – If the method cannot be used in this context, e.g. without a secure connection.
- configure()¶
- class gws.plugin.qfieldcloud.auth.Result¶
Bases:
gws.DataResult of a successful authentication.
- expiresAt: datetime.datetime¶
Expiry time of the session.
- sess: gws.AuthSession¶
Session of the user.