class documentation

class SessionAuthentication(BaseAuthentication): (source)

View In Hierarchy

Use Django's session framework for authentication.

Method authenticate Returns a `User` if the request session currently has a logged in user. Otherwise returns `None`.
Method enforce_csrf Enforce CSRF validation for session based authentication.

Inherited from BaseAuthentication:

Method authenticate_header Return a string to be used as the value of the `WWW-Authenticate` header in a `401 Unauthenticated` response, or `None` if the authentication scheme should return `403 Permission Denied` responses.
def authenticate(self, request): (source)

Returns a `User` if the request session currently has a logged in user. Otherwise returns `None`.

def enforce_csrf(self, request): (source)

Enforce CSRF validation for session based authentication.