DVSessionAuthentication class

The session stage a backend process runs.

Constructors

DVSessionAuthentication({DVSessions? sessions, FutureOr<Object?> resolveUser(DVSession session)?, DVSessionCookie cookie = const DVSessionCookie(), bool development = false})

Properties

The cookie a browser carries the session in.
final
development → bool
Whether the cookie is read under its development name. Outside development only the __Host- name is the session: a cookie under the bare name is one a sibling subdomain could have set.
final
hashCode → int
The hash code for this object.
no setterinherited
resolveUser → FutureOr<Object?> Function(DVSession session)?
The application's user for a live session, read on every request: its server-safe representation, which is what a policy written against the application's user type is handed. Null from it refuses the session -- the person it belonged to no longer exists.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

authenticate({String? authorization, String? cookie, String? tenant, bool plainLocal = false}) → Future<DVSessionAuthenticationResult>
Resolves the session a request presents on tenant, or the current tenant when none is given.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

installed → DVSessionAuthentication?
The session stage this process runs, or null before one is installed.
no setter
sessions → DVSessions
The sessions the installed stage checks: where a sign-in creates one, and a sign-out revokes it.
no setter

Static Methods

authenticateRequest({String? authorization, String? cookie, bool plainLocal = false}) → Future<DVSessionAuthenticationResult>
The stage for a request whose Authorization header is authorization and whose Cookie header is cookie, on the current tenant.
credentialOf(String? authorization) → String?
The session token in an Authorization header, or null when it carries none -- which includes an API key, an OAuth token and the application's other bearer tokens.
install({DVSessions? sessions, FutureOr<Object?> resolveUser(DVSession session)?, DVSessionCookie cookie = const DVSessionCookie(), bool development = false}) → DVSessionAuthentication
Makes a session stage this process's. The generated startBackend installs one over the application's database unless the application installed its own first -- which is where it passes resolveUser.
uninstall() → void
Takes the installed stage away, for a test.

Constants

mfaChallenge → const String
The challenge for a session still waiting for its second factor: RFC 9470's step-up error, which says "present more", where invalid_token would say "sign in again".