Skip to main content
Bruce C
New Voice
New Voice
October 30, 2025
Solved

requestJWTUserToken returns unknownHostException in prod

  • October 30, 2025
  • 1 reply
  • 81 views

I am having no issues with the development environment; however, in production when I call the apiClient.requestJWTUserToken I’m getting back an error message.  “java.net.UnknownHostException: https”

CODE
    OAuthToken getToken(String apiClientUrl, String oAuthPath, 
            String clientId, String userId, 
            ArrayList<String> scopes, String keyValue) throws IllegalArgumentException, ApiException, IOException {
        ApiClient apiClient =this.getApiClient(apiClientUrl, oAuthPath);
        return apiClient.requestJWTUserToken(clientId, userId, scopes, keyValue.getBytes(), 3600);
    }

In dev the apiClient is using apiClientUrl = https://demo.docusign.net/restapi

the oAuthPath value is https://account-d.docusign.com

 

In production the apiClient is using apiClientUrl=https://www.docusign.net/restapi/v2.1

the oAuthPath value is https://account.docusign.com

I have verified the clientid, userid, scopes, and rsaPrivateKey values are correct.
I am able to ping account.docusign.com and www.docusign.net.

Am I using an incorrect url?   Any thoughts would be appreciated.

 

Best answer by JohnSantos

@Bruce C 

Your OAuth base path is wrong for the Java SDK. You’re passing a full URL. The SDK wants only the hostname.

Changing oAuthPath from https://account.docusign.com to account.docusign.com should resolve it.

1 reply

JohnSantos
Guru
Guru
October 31, 2025

@Bruce C 

Your OAuth base path is wrong for the Java SDK. You’re passing a full URL. The SDK wants only the hostname.

Changing oAuthPath from https://account.docusign.com to account.docusign.com should resolve it.

Welcome to the DocuSign Community! Your feedback is highly valued. If you find my response helpful, please give it a "Like" and consider marking it as the "Best Answer" to assist others with similar issues.