Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAuthorizationURL return a malformed URI #168

Open
ta7tou7 opened this issue Oct 6, 2020 · 7 comments
Open

getAuthorizationURL return a malformed URI #168

ta7tou7 opened this issue Oct 6, 2020 · 7 comments
Assignees

Comments

@ta7tou7
Copy link

ta7tou7 commented Oct 6, 2020

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
Copy link
Contributor

@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
Copy link
Author

ta7tou7 commented Oct 15, 2020

@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 one https://account.docusign.com/...`

@ta7tou7
Copy link
Author

ta7tou7 commented Oct 15, 2020

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
Copy link
Contributor

@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
Copy link
Contributor

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

@avromf
Copy link

avromf commented May 17, 2022

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants