buildJWT method

String buildJWT(
  1. CTokenBody body
)

Implementation

String buildJWT(CTokenBody body) {
  var claims = JsonWebTokenClaims.fromJson({
    "exp": body.expSeconds,
    "iss": body.user,
    "sub": body.subject,
    "aud": [body.client],
  });
  var builder = JsonWebSignatureBuilder();
  builder.jsonContent = claims.toJson();
  builder.addRecipient(_jsonWebKey);
  var token = builder.build();
  return token.toCompactSerialization();
}