public String getJwtTokenUsingBuilder(String testName, LibertyServer server, String builderId, List<NameValuePair> extraClaims) throws Exception {

        String jwtBuilderUrl = SecurityFatHttpUtils.getServerUrlBase(server) + "/jwtbuilder/build";

        List<NameValuePair> requestParams = setRequestParms(builderId, extraClaims);

        WebClient webClient = new WebClient();
        Page response = invokeUrlWithParameters(testName, webClient, jwtBuilderUrl, requestParams);
        Log.info(thisClass, testName, "JWT builder app response: " + WebResponseUtils.getResponseText(response));

        Cookie jwtCookie = webClient.getCookieManager().getCookie("JWT");
        Log.info(thisClass, testName, "Built JWT cookie: " + jwtCookie);
        Log.info(thisClass, testName, "Cookie value: " + jwtCookie.getValue());
        return jwtCookie.getValue();

    }
public String getJwtTokenUsingBuilder ( String testName , LibertyServer server , String builderId , List < NameValuePair > extraClaims ) throws Exception { String jwtBuilderUrl = SecurityFatHttpUtils . getServerUrlBase ( server ) + "/jwtbuilder/build" ; List < NameValuePair > requestParams = setRequestParms ( builderId , extraClaims ) ; WebClient webClient = new WebClient ( ) ; Page response = invokeUrlWithParameters ( testName , webClient , jwtBuilderUrl , requestParams ) ; Log . info ( thisClass , testName , "JWT builder app response: " + WebResponseUtils . getResponseText ( response ) ) ; Cookie jwtCookie = webClient . getCookieManager ( ) . getCookie ( "JWT" ) ; Log . info ( thisClass , testName , "Built JWT cookie: " + jwtCookie ) ; Log . info ( thisClass , testName , "Cookie value: " + jwtCookie . getValue ( ) ) ; return jwtCookie . getValue ( ) ; }
anyone calling this method needs to add upn to the extraClaims that it passes in (if they need it)