BearerTokenExtractable class final

Extracts the token from an Authorization: Bearer <token> header.

Every bearer scheme starts by stripping that prefix and answering 401 with the right challenge when it is missing. Doing it once means a custom extractor starts from the token rather than from the header.

Implemented types

Constructors

BearerTokenExtractable({String challenge = 'Bearer'})
Reads a bearer token.
const

Properties

challenge String
The WWW-Authenticate challenge sent with a 401.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

extract(Request request) Future<Result<String, Rejection>>
Produces the value, or the rejection that stops the handler.
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