docusign / docusign-objc-client

The Official DocuSign Objective-C Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
https://www.docusign.com/devcenter
MIT License
13 stars 14 forks source link

BaseURL confusion #14

Closed toseefkhilji closed 4 years ago

toseefkhilji commented 6 years ago

Hi, I am using DSApiClient's configure_jwt_authorization_flow function , Then i use this client to initialize an DSAuthenticationApi object and then i use this objects loginWithApiPassword method for logging.

Now I have some confusion related to BaseURL.

For creating DSApiClient I'm using initWithBaseURL:method, where i have to pass my base url. And I'll get correct base URL after login (i.e loginAccount.baseUrl ).

For Production Which base URL I have to use to create DSApiClient object??

In Test code on Readme file https://demo.docusign.net/restapi URL is used for creating DSApiClient object and after login it is updating with correct base url.

Please let me correct if I understand wrongly.

LarryKlugerDS commented 4 years ago

The DSAuthenticationApi object is deprecated. I am sorry that this is not more clear in the Swagger file or in the machine-generated SDKs.

The best flow:

  1. Use an OAuth flow to obtain an access token. You can use JWT Grant, Authorization Code Grant, or Implicit Grant.
  2. Use OAuth UserInfo API method to obtain the user's name, email, DocuSign account ID(s), and the accounts' base URLs.
  3. Set the SDK to use the base URL for the user's account that you've decided to use. This is usually the user's default account, but you should also enable the user to choose a different account.