BasicAuthAuthenticator constructor
BasicAuthAuthenticator(})
Authenticates against a fixed credentials map (username → password).
The resulting principal is granted the roles from roles (if provided).
Implementation
BasicAuthAuthenticator(
Map<String, String> credentials, {
Set<String> Function(String username)? roles,
}) : _resolve = ((username, password) async {
if (credentials[username] != password) return null;
return Principal(
id: username,
displayName: username,
roles: roles?.call(username) ?? const {},
);
});