AuthMiddleware class

Authentication middleware for HTTP requests

Constructors

AuthMiddleware({required TokenValidator validator, List<String> publicPaths = const ['/health', '/ping'], List<String> defaultRequiredScopes = const [], bool strictMode = true})

Properties

defaultRequiredScopes List<String>
final
hashCode int
The hash code for this object.
no setterinherited
publicPaths List<String>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
strictMode bool
final
validator TokenValidator
final

Methods

authenticate(HttpRequest request, {List<String>? requiredScopes}) Future<AuthResult?>
Process HTTP request authentication
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendAuthChallenge(HttpRequest request, {String? error, String? errorDescription}) → void
Send authentication challenge response
sendForbidden(HttpRequest request, {String? reason}) → void
Send forbidden response
toString() String
A string representation of this object.
inherited

Operators

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