java/src/main/java/com/genexus/security/web/jose/jwt/JWTSigner.java
/**
     * Generate a JSON Web Token.
     *
     * @param claims  A map of the JWT claims that form the payload. Registered claims
     *                must be of appropriate Java datatype as following:
     *                <ul>
     *                <li>iss, sub: String
     *                <li>exp, nbf, iat, jti: numeric, eg. Long
     *                <li>aud: String, or Collection&lt;String&gt;
     *                </ul>
     *                All claims with a null value are left out the JWT.
     *                Any claims set automatically as specified in
     *                the "options" parameter override claims in this map.
     * @param options Allow choosing the signing algorithm, and automatic setting of some registered claims.
     */
Generate a JSON Web Token.
@param claims  A map of the JWT claims that form the payload. Registered claims
must be of appropriate Java datatype as following:

iss, sub: String
exp, nbf, iat, jti: numeric, eg. Long
aud: String, or Collection<String>

All claims with a null value are left out the JWT.
Any claims set automatically as specified in
the "options" parameter override claims in this map.
@param options Allow choosing the signing algorithm, and automatic setting of some registered claims.
Generate a JSON Web Token . @param claims A map of the JWT claims that form the payload . Registered claims must be of appropriate Java datatype as following : iss sub : String exp nbf iat jti : numeric eg . Long aud : String or Collection<String > All claims with a null value are left out the JWT . Any claims set automatically as specified in the " options " parameter override claims in this map . @param options Allow choosing the signing algorithm and automatic setting of some registered claims .
public String sign(final Map<String, Object> claims, final Options options) {        
        final Algorithm algorithm = (options != null && options.algorithm != null) ? options.algorithm : DEFAULT_ALGORITHM;
        final List<String> segments = new ArrayList<String>();
        try {
            segments.add(encodedHeader(algorithm));
            segments.add(encodedPayload(claims, options));
            segments.add(encodedSignature(join(segments, "."), algorithm));
            return join(segments, ".");
        } catch (Exception e) {
            throw new RuntimeException(e.getCause());
        }
    }
public String sign ( final Map < String , Object > claims , final Options options ) { final Algorithm algorithm = ( options != null && options . algorithm != null ) ? options . algorithm : DEFAULT_ALGORITHM ; final List < String > segments = new ArrayList < String > ( ) ; try { segments . add ( encodedHeader ( algorithm ) ) ; segments . add ( encodedPayload ( claims , options ) ) ; segments . add ( encodedSignature ( join ( segments , "." ) , algorithm ) ) ; return join ( segments , "." ) ; } catch ( Exception e ) { throw new RuntimeException ( e . getCause ( ) ) ; } }
Generate a JSON Web Token.
Generate a JSON Web Token .