private Response doFormPost(final Invocation.Builder invocationBuilder) {
        final MultivaluedMap<String, String> formParamsMap = new MultivaluedHashMap<>();

        final BiConsumer<String, String> mapAddFunc = (name, val) -> {
            if (!NullSafe.isBlankString(val)) {
                formParamsMap.add(name, val);
            }
        };

        mapAddFunc.accept(OpenId.CLIENT_ID, getClientId());
        mapAddFunc.accept(OpenId.CLIENT_SECRET, getClientSecret());
        mapAddFunc.accept(OpenId.CODE, code);
        mapAddFunc.accept(OpenId.GRANT_TYPE, grantType);
        mapAddFunc.accept(OpenId.REDIRECT_URI, redirectUri);
        mapAddFunc.accept(OpenId.REFRESH_TOKEN, refreshToken);
        mapAddFunc.accept(OpenId.SCOPE, getScopesAsString());

        // application/x-www-form-urlencoded in, application/json out
        invocationBuilder.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_TYPE);

        LOGGER.debug("Form name/value pairs: {}", formParamsMap);
        return invocationBuilder.post(Entity.form(formParamsMap));
    }
Allows you do define client credentials that differ from those in {@link OpenIdConfiguration}
stroom-security/stroom-security-common-impl/src/main/java/stroom/security/common/impl/OpenIdTokenRequestHelper.java