AuthResult class

Authentication result

Annotations
  • @immutable

Constructors

AuthResult({required bool isAuthenticated, Map<String, dynamic>? userInfo, String? error, List<String>? validatedScopes, List<String>? audience})
const
AuthResult.failure({required String? error})
Create failed authentication result
const
AuthResult.success({required Map<String, dynamic>? userInfo, List<String>? validatedScopes, List<String>? audience})
Create successful authentication result
const

Properties

audience → List<String>?
The audiences the token was issued for (aud), when the validator knows them. When given, the server's resource identifier (its Protected Resource Metadata resource) must be among them; a validator that leaves this null has checked the audience itself.
final
error → String?
Error message if authentication failed
final
hashCode → int
The hash code for this object.
no setterinherited
isAuthenticated → bool
Whether authentication was successful
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
userInfo → Map<String, dynamic>?
Authenticated user information
final
validatedScopes → List<String>?
The scopes the token grants. The server compares them with the scopes an operation requires (see AuthMiddleware.requiredScopes) and answers 403 insufficient_scope when they fall short.
final

Methods

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