docusign / docusign-esign-java-client

The Official Docusign Java Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://javadoc.io/doc/com.docusign/docusign-esign-java/latest/index.html
MIT License
105 stars 96 forks source link

AuthName comparison #102

Closed santa010 closed 5 years ago

santa010 commented 5 years ago

In the ApiClient class, the String authName comparison is done with == like so

public ApiClient(String oAuthBasePath, String[] authNames) {
    this();
    this.setOAuthBasePath(oAuthBasePath);
    for(String authName : authNames) {
      Authentication auth;
      if (authName == "docusignAccessCode") {
        auth = new OAuth(httpClient, OAuthFlow.accessCode, oAuthBasePath + "/oauth/auth", oAuthBasePath + "/oauth/token", "all");
      } else if (authName == "docusignApiKey") {
        auth = new ApiKeyAuth("header", "docusignApiKey");
      } else {
        throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
      }
      addAuthorization(authName, auth);
    }
  }

It should use equals instead.

mmallis87 commented 5 years ago

@santa010 thank you for catching this. The fix will be deployed very soon in the official 2.9.0 version.

mmallis87 commented 5 years ago

Hi, We have fixed the issues with new eSignature API version and new SDK release candidate. Please have a look at v2.9.0 of the Maven/Gradle package.

Let us know if this resolves the issue.

santa010 commented 5 years ago

Hi, the issue seems to be resolved with v2.9.0.