JwtOptions class
Configuration options for JWT verification.
Constructors
-
JwtOptions({bool enabled = true, String? issuer, List<
String> audience = const <String>[], List<String> requiredClaims = const <String>[], Uri? jwksUri, List<Map< inlineKeys = const <Map<String, dynamic>>[], List<String, dynamic> >String> algorithms = const <String>['RS256'], Duration clockSkew = const Duration(seconds: 60), Duration jwksCacheTtl = const Duration(minutes: 5), String header = 'Authorization', String bearerPrefix = 'Bearer ', String cookieName = 'routed_auth_token'}) -
Creates a JwtOptions instance with the specified parameters.
const
Properties
-
algorithms
→ List<
String> -
The allowed algorithms for JWT verification.
final
-
audience
→ List<
String> -
The expected audience of the JWT.
final
- bearerPrefix → String
-
The prefix for the JWT in the authorization header.
final
- clockSkew → Duration
-
The allowed clock skew for token validation.
final
-
Cookie name to read/write JWT tokens.
final
- enabled → bool
-
Whether JWT verification is enabled.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → String
-
The HTTP header used to pass the JWT.
final
-
inlineKeys
→ List<
Map< String, dynamic> > -
Inline keys for verifying the JWT.
final
- issuer → String?
-
The expected issuer of the JWT.
final
- jwksCacheTtl → Duration
-
The cache time-to-live for JWKS.
final
- jwksUri → Uri?
-
The URI for fetching JSON Web Key Sets (JWKS).
final
-
requiredClaims
→ List<
String> -
The required claims that must be present in the JWT.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{bool? enabled, String? issuer, List< String> ? audience, List<String> ? requiredClaims, Uri? jwksUri, List<Map< ? inlineKeys, List<String, dynamic> >String> ? algorithms, Duration? clockSkew, Duration? jwksCacheTtl, String? header, String? bearerPrefix, String? cookieName}) → JwtOptions - Creates a copy of this JwtOptions with the specified overrides.
-
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