public String createTokenString ( String builderConfigId ) { try { return createTokenString ( builderConfigId , WSSubject . getRunAsSubject ( ) , null , null ) ; // JwtBuilder builder = JwtBuilder.create(builderConfigId); // // // all the "normal" stuff like issuer, aud, etc. is handled // // by the builder, we only need to add the mp-jwt things // // that the builder is not already aware of. // String user = getUserName(); // builder.subject(user); // builder.claim(USER_CLAIM, user); // // ArrayList<String> groups = getGroups(); // if (isValidList(groups)) { // builder.claim(GROUP_CLAIM, groups); // } // // return builder.buildJwt().compact(); } catch ( Exception e ) { // ffdc return null ; } }
create an MP - JWT token using the builder API . Assumes the user is already authenticated .