Outdated examples

Issue #243 resolved
Chris Cowan created an issue

Each of the "JWT with *" pages at https://connect2id.com/products/nimbus-jose-jwt/examples use the pre-builder version of JWTClaimsSet that doesn't exist in 5.1. The "// Prepare JWT with claims set" part should be updated to:

        // Prepare JWT with claims set
        JWTClaimsSet claimsSet = new JWTClaimsSet.Builder()
                .subject("alice")
                .issuer("https://c2id.com")
                .expirationTime(new Date(new Date().getTime() + 60 * 1000))
                .build();

The final line on each of those pages ("assertTrue(new Date()...") is missing one closing parenthese at the end before the semicolon.

The examples at https://connect2id.com/products/nimbus-jose-jwt/examples/jwt-with-ec-signature and https://connect2id.com/products/nimbus-jose-jwt/examples/jws-with-ec-signature both reference the now non-existent ECKey.Curve, which is now just Curve.

Comments (2)

  1. Vladimir Dzhuvinov

    All examples where checked and updated / fixed where necessary.

    The Curve class was factored out in order to support "octet key pair" for Ed25519 crypto.

    Thanks for making us aware of all that. I wish one day we'll have a nice way of keeping examples in sync and validated automatically.

  2. Log in to comment