gws.plugin.auth_method.token¶
HTTP token authentication method.
The client passes a token in an HTTP header. The method reads the configured
header, checks the optional prefix and passes the token to the authentication
providers as token credentials. For an authenticated user, the token is
stored in user.authToken and a transient session is opened. No cookie is
set.
The prefix is compared case-insensitively. Without a prefix, the header value must be the token alone.
Example:
auth.methods+ {
type "token"
header "X-My-Auth"
prefix "Bearer"
}
With this configuration, the application expects a header like
X-My-Auth: Bearer <token>.
Source code: gws.plugin.auth_method.token
Package Contents¶
- class gws.plugin.auth_method.token.Config¶
Bases:
gws.base.auth.method.ConfigAuthentication with a token passed in an HTTP header.