onconova.core.auth.token
Module providing a custom authentication class for session-based authentication using the X-SESSION-TOKEN HTTP header in Django.
XSessionTokenAuth
¶
Bases: XSessionTokenAuth
Custom authentication class for session-based authentication using the X-SESSION-TOKEN HTTP header.
This class extends XSessionTokenAuthBase to provide compatibility with django-allauth in headless mode. It also adds OpenAPI metadata for schema generation, specifying the authentication type, location, and header name.
Attributes:
| Name | Type | Description |
|---|---|---|
openapi_type |
str
|
The OpenAPI security scheme type ( |
openapi_in |
str
|
The location of the API key ( |
openapi_name |
str
|
The name of the header containing the session token ( |
Methods:
| Name | Description |
|---|---|
__call__ |
HttpRequest) -> Optional[User]:
Authenticates the user using the |
openapi_in
class-attribute
instance-attribute
¶
openapi_name
class-attribute
instance-attribute
¶
openapi_type
class-attribute
instance-attribute
¶
__call__(request)
¶
Authenticate the user using the X-SESSION-TOKEN header.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
HttpRequest
|
Incoming HTTP request. |
required |
Returns:
| Type | Description |
|---|---|
User | None
|
The authenticated user if the token is valid, otherwise None. |