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

getAuthorizationURL return a malformed URI #168

Open ta7tou7 opened 3 years ago

ta7tou7 commented 3 years ago

We have upgraded recently our version from 3.6 to 3.8 and we have noticed a regression regarding the built URI.

our current code to build the uri is:

ApiClient client = new ApiClient();
client.setOAuthBasePath(authServerUrl);
URI uri = getAuthorizationUri(clientId, scopes, redirectUri, "code", state);

with an authServerUrl = 'account.docusign.com'

What we got in the output is: 'https:/account.docusign.com' instead of `https://account.docusign.com' (one missing slash after https)

mmallis87 commented 3 years ago

@ta7tou7 apologies for not reaching out earlier. If this is still an issue, in order for us to reproduce the scenario, we need to know how to get to this malformed URI? Are you using System.out.println, using an IDE debugger or enabling verbose logs? Please share more details if possible.

ta7tou7 commented 3 years ago

@mmallis87

ApiClient client = new ApiClient();
client.setOAuthBasePath(authServerUrl);
URI authUri = client.getAuthorizationUri(clientId, scopes,redirectUri, "code", state);
return authUri.toString();

When using account.docusign.com as "authServerUrl" what we got with the method above is => https:account.docusign.com/...' while we need an url with like this onehttps://account.docusign.com/...`

ta7tou7 commented 3 years ago

I have tried also to add the scheme the the authServerUrl => https://account.docusign.com instead of account.docusign.com but while I get the right url with the method above, I wouldn't be able to generate the access token (duplicated https => see method ApiClient.#generateAccessToken line 614)

mmallis87 commented 3 years ago

@ta7tou7 I still don't know where do you see the generated URL. Do you log the value to the console, do you open it in a browser window or do you inspect it via an IDE. Please tell us which one of these methods do you use and if you can share a screenshot that will be great!

LarryKlugerDS commented 3 years ago

closing due to lack of activity. Please re-open of this is still an issue. Thank you

avromf commented 2 years ago

FYI:

This is still an issue with version 3.18. To reproduce:

ApiClient apiClient = new ApiClient();
apiClient.setOAuthBasePath("account-d.docusign.com");
URI uri = apiClient.getAuthorizationUri(clientId, List.of("signature"), "http://localhost/", "code");
System.out.println(uri);

This results in a uri starting with: https:account-d.docusign.com/oauth/auth?response_type=code...

Explicitly adding "https://" to the beginning of the OAuth base path works.

mmallis87 commented 2 years ago

Thank you all for sharing these code snippets. I create an internal ticket for me and the team to investigate further.