generateWampCRAChallenge function

String generateWampCRAChallenge(
  1. int sessionID,
  2. String authID,
  3. String authRole,
  4. String provider,
)

Implementation

String generateWampCRAChallenge(int sessionID, String authID, String authRole, String provider) {
  final nonce = generateNonce();

  final data = {
    "nonce": nonce,
    "authprovider": provider,
    "authid": authID,
    "authrole": authRole,
    "authmethod": "wampcra",
    "session": sessionID,
    "timestamp": utcNow(),
  };

  return json.encode(data);
}