BearerTokenAuthenticator class

Authenticates Authorization: Bearer <token> requests.

A missing Authorization header (or a non-Bearer scheme) yields anonymous (null) so the token authenticator composes with others; a Bearer header with an unknown token throws UnauthorizedException.

Implemented types

Constructors

BearerTokenAuthenticator(Map<String, Principal> tokens)
Authenticates against a fixed tokens map (token → principal).
BearerTokenAuthenticator.resolver(TokenResolver resolver)
Authenticates by delegating token validation to resolver.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

authenticate(HubRequest request) Future<Principal?>
Authenticates request. See the class contract for the return/throw semantics.
override
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