AuthContext class

Authorization context for MCP requests

Annotations
  • @immutable

Constructors

AuthContext({required Map<String, dynamic> userInfo, List<String> scopes = const [], String? token, required DateTime timestamp})
const

Properties

clientId → String?
Get client ID
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scopes → List<String>
Validated scopes for this request
final
timestamp → DateTime
Request timestamp
final
token → String?
Original authentication token
final
userId → String?
Get user ID
no setter
userInfo → Map<String, dynamic>
Authenticated user information
final
username → String?
Get username
no setter

Methods

hasScope(String scope) → bool
Check if context has specific scope
hasScopes(List<String> requiredScopes) → bool
Check if context has all required scopes
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Convert to JSON for logging/debugging
toString() → String
A string representation of this object.
inherited

Operators

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