JwtHeader.fromJson constructor

JwtHeader.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory JwtHeader.fromJson(Map<String, dynamic> json) {
  json = json.clone();
  return JwtHeader(
      alg: JwtSupportedAlgorithm.fromName(json['alg']),
      typ: json['typ'],
      kid: json['kid'],
      cty: json['cty'],
      customClaims: json
        ..removeWhere((k, v) => ['typ', 'kid', 'cty'].contains(k)));
}