sasl_scram 0.1.1 copy "sasl_scram: ^0.1.1" to clipboard
sasl_scram: ^0.1.1 copied to clipboard

A Package providing sasl/scram authentication. Both scram-1 and scram-256 are managed.

Sasl Scram for Dart #

Implementation of the Salted Challenge Response Authentication Mechanism in Dart.

Usage #

A simple usage example:

import 'dart:typed_data';

import 'package:crypto/crypto.dart';
import 'package:sasl_scram/sasl_scram.dart';

void main() {
  final bytesReceivedFromServer = Uint8List(0); // No data needed when starting authentication

  final authenticator = ScramAuthenticator(
    'SCRAM-SHA-256', // Optionally choose hash method from a list provided by the server
    sha256,
    UsernamePasswordCredential(username: 'dart', password: 'dart'),
  );

  final bytesToSentToServer = authenticator.handleMessage(
    SaslMessageType.AuthenticationSASL, // Get type type from the server message
    bytesReceivedFromServer, // Append the remaining bytes
  );
  print(bytesToSentToServer); // Wrap these bytes with your message which goes back to the server
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

3
likes
150
pub points
66%
popularity

Publisher

unverified uploader

A Package providing sasl/scram authentication. Both scram-1 and scram-256 are managed.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

buffer, collection, crypto, saslprep

More

Packages that depend on sasl_scram