Reputation: 1
We are integrating DocuSign on our platform for our customers to be able to sign contract agreements using the eSignature API. Currently, our API can create the contracts for the customer to sign and front-end development is mostly complete. Our Angular application is also packaged in a Cordova container and installable via AppStore and Google Play.
We are trying to integrate the DocuSign Android SDK by wrapping it into a Cordova plugin. We are having trouble using the signOnline method of the SDK because the authentication is not working. We are using the 3rd login method overload; however, when loading the contracts, we get an "Invalid access token" error:
The token is obtained by the .NET Core API using the RequestJWTUserToken API because the customers do not have their own DocuSign accounts (which is why we do not want to use the other 2 login methods that bring up UI for username and password entry), and the API passes the token for the Android client app to use. The description of the method in the docs that we are trying to use does not provide more details.
Would someone provide more insights on how we launch the signOnline UI of Android SDK when the contract is created by the the API and ready for signing, and the user does not have DocuSign account?
Also, our request for a JWT includes the impersonate user ID.
Thank you, chris n
Upvotes: 0
Views: 193
Reputation: 186
When you use JWT to generate access token, the access token life time is 1 hour. After the token is expired, if you invoke SDK's signOnline() api, then it returns SigningException with 'Invalid access token' message and that is expected. In the Android SDK's login() API, make sure that you pass token expiry value for 'expiresIn' attribute. So, after the new access token is generated via JWT, the token expiry value should be passed in SDK login() api. You can use SDK's authenticaionDelegate.isSessionActive() api to know if the access token is expired/valid. If token is expired, you need to refetch new access token from your backend and invoke android SDK's login api with new access token and expiresIn values.
Upvotes: 2