setAuthenticate method
Sets the function to be called when a site is requesting authentication.
Pass through setter of HttpClient.authenticate. This callback called
when server returns Unauthorized (401). addCredentials can be called
in this callback method to authorize client.
Return false
when authorization cannot be provided."
Example:
client.setAuthenticate((url, scheme, realm) {
client.addCredentials(...);
return Future.value(true);
});
Implementation
@override
void setAuthenticate(
Future<bool> Function(Uri url, String scheme, String? realm)? f) =>
client.authenticate = f;