toJson method

Map<String, dynamic> toJson()

Converts this instance to a JSON map.

Implementation

Map<String, dynamic> toJson() {
  return {
    'challenge': challenge,
    'rp': relyingParty.toJson(),
    'user': user.toJson(),
    'pubKeyCredParams': ?pubKeyCredParams?.map((e) => e.toJson()).toList(),
    'timeout': ?timeout,
    if (excludeCredentials.isNotEmpty)
      'excludeCredentials': excludeCredentials
          .map((e) => e.toJson())
          .toList(),
    'authenticatorSelection': ?authSelectionType?.toJson(),
    'attestation': ?attestation,
    if (prf != null)
      'extensions': {
        'prf': {
          'eval': {'first': prf},
        },
      },
  };
}