@Deprecated public void configureJWTAuthorizationFlow(String publicKeyFilename, String privateKeyFilename, String oAuthBasePath, String clientId, String userId, long expiresIn) throws IOException, ApiException {
    try {
      String assertion = JWTUtils.generateJWTAssertion(publicKeyFilename, privateKeyFilename, oAuthBasePath, clientId, userId, expiresIn);
      MultivaluedMap<String, String> form = new MultivaluedMapImpl();
      form.add("assertion", assertion);
      form.add("grant_type", OAuth.GRANT_TYPE_JWT);

      Client client = buildHttpClient(debugging);
      WebResource webResource = client.resource("https://" + oAuthBasePath + "/oauth/token");
      ClientResponse response = webResource
              .type(MediaType.APPLICATION_FORM_URLENCODED_TYPE)
              .post(ClientResponse.class, form);

      ObjectMapper mapper = new ObjectMapper();
      mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
      JsonNode responseJson = mapper.readValue(response.getEntityInputStream(), JsonNode.class);
      if (!responseJson.has("access_token") || !responseJson.has("expires_in")) {
        throw new ApiException("Error while requesting an access token: " + responseJson);
      }
      String accessToken = responseJson.get("access_token").asText();
      expiresIn = responseJson.get("expires_in").asLong();
      setAccessToken(accessToken, expiresIn);
    } catch (JsonParseException e) {
      throw new ApiException("Error while parsing the response for the access token.");
    } catch (JsonMappingException e) {
      throw e;
    } catch (IOException e) {
      throw e;
    }
  }
@ Deprecated public void configureJWTAuthorizationFlow ( String publicKeyFilename , String privateKeyFilename , String oAuthBasePath , String clientId , String userId , long expiresIn ) throws IOException , ApiException { try { String assertion = JWTUtils . generateJWTAssertion ( publicKeyFilename , privateKeyFilename , oAuthBasePath , clientId , userId , expiresIn ) ; MultivaluedMap < String , String > form = new MultivaluedMapImpl ( ) ; form . add ( "assertion" , assertion ) ; form . add ( "grant_type" , OAuth . GRANT_TYPE_JWT ) ; Client client = buildHttpClient ( debugging ) ; WebResource webResource = client . resource ( "https://" + oAuthBasePath + "/oauth/token" ) ; ClientResponse response = webResource . type ( MediaType . APPLICATION_FORM_URLENCODED_TYPE ) . post ( ClientResponse . class , form ) ; ObjectMapper mapper = new ObjectMapper ( ) ; mapper . configure ( DeserializationFeature . FAIL_ON_UNKNOWN_PROPERTIES , false ) ; JsonNode responseJson = mapper . readValue ( response . getEntityInputStream ( ) , JsonNode . class ) ; if ( ! responseJson . has ( "access_token" ) || ! responseJson . has ( "expires_in" ) ) { throw new ApiException ( "Error while requesting an access token: " + responseJson ) ; } String accessToken = responseJson . get ( "access_token" ) . asText ( ) ; expiresIn = responseJson . get ( "expires_in" ) . asLong ( ) ; setAccessToken ( accessToken , expiresIn ) ; } catch ( JsonParseException e ) { throw new ApiException ( "Error while parsing the response for the access token." ) ; } catch ( JsonMappingException e ) { throw e ; } catch ( IOException e ) { throw e ; } }
Configures the current instance of ApiClient with a fresh OAuth JWT access token from DocuSign
@param publicKeyFilename the filename of the RSA public key
@param privateKeyFilename the filename of the RSA private key
@param oAuthBasePath DocuSign OAuth base path (account-d.docusign.com for the developer sandbox
and account.docusign.com for the production platform)
@param clientId DocuSign OAuth Client Id (AKA Integrator Key)
@param userId DocuSign user Id to be impersonated (This is a UUID)
@param expiresIn number of seconds remaining before the JWT assertion is considered as invalid
@throws IOException if there is an issue with either the public or private file
@throws ApiException if there is an error while exchanging the JWT with an access token
@deprecated  As of release 2.7.0, replaced by {@link #requestJWTUserToken()} and {@link #requestJWTApplicationToken()}