How to log in to Docusign from your app
This topic demonstrates how to log in to Docusign from your app.
Required data
Running the code in this how-to requires this data:
Step 1. Obtain your OAuth token
To make the API call shown in this how-to, you need a valid OAuth access token. The Docusign Android SDK supports access tokens for two different OAuth grant types: Authorization Code Grant and JSON Web Token (JWT) Grant. Choose the OAuth grant type appropriate for your scenario. See Authenticate for guidance on your options to get an OAuth token.
Step 2. Initialize a Docusign instance
Use the method shown to initialize a Docusign instance. Call this from the onCreate() method in your Application class.
Note: This how-to initializes a Docusign instance for the developer environment. For production, use
DSEnvironment.PRODUCTION_ENVIRONMENT.
Step 3. Log in to Docusign
Use the method shown to log in to Docusign. Be sure to substitute {ACCESS_TOKEN} for the token obtained in Step 1.
Expected response
If your login is successful, the onSuccess method in the listener defined in Step 3 will be triggered, and a DSUser object is returned. You will now be able to make API calls.