issueScramToken method

Future<ConnectanumHttpAuthGrant> issueScramToken({
  1. required String realm,
  2. required String authId,
  3. required String secret,
  4. Map<String, String> headers = const <String, String>{},
})

Implementation

Future<ConnectanumHttpAuthGrant> issueScramToken({
  required String realm,
  required String authId,
  required String secret,
  Map<String, String> headers = const <String, String>{},
}) async {
  final authentication = ScramAuthentication(secret);
  try {
    return await authenticate(
      realm: realm,
      authId: authId,
      authentication: authentication,
      authMethod: 'scram',
      headers: headers,
    );
  } finally {
    await authentication.dispose();
  }
}