@Override
    public String newId() {
        final Instant now = Instant.now();
        final int un2 = ThreadLocalRandom.current().nextInt(Integer.MAX_VALUE) & 0x7fffffff;
        return JWT.create()
                  .withIssuer(issuer)
                  .withIssuedAt(Date.from(now))
                  .withExpiresAt(Date.from(now.plus(validSeconds, ChronoUnit.SECONDS)))
                  // To make multiple tokens issued in the same second unique, we add uniquifiers.
                  .withClaim(CLAIM_NAME_UNIQUIFIER1, un1)
                  .withClaim(CLAIM_NAME_UNIQUIFIER2, un2)
                  .sign(algorithm);
    }
A {@link SamlRequestIdManager} implementation based on JSON Web Tokens specification.

@see <a href="https://jwt.io/">JSON Web Tokens</a>
saml/src/main/java/com/linecorp/armeria/server/saml/JwtBasedSamlRequestIdManager.java