docusign / mobile-android-sdk

The Official Docusign Android SDK for integrating e-signature & signing documents. Click the link below to view SDK API Documentation https://docusign.github.io/mobile-android-sdk/
Other
16 stars 12 forks source link

Authenticates the DocuSign user with the provided authToken and optional refreshToken. #9

Closed Karthikrajt closed 3 years ago

Karthikrajt commented 3 years ago

How to get authToken

naveentds commented 3 years ago

Hi @Karthikrajt, for retrieving authToken, you can refer to https://developers.docusign.com/platform/auth/authcode/authcode-get-token/ In DocuSign Android SDK, for convenience, we provide an api to login. val authenticationDelegate = DocuSign.getinstance().getAuthenticationDelegate() authenticationDelegate .login(requestCode: Int, context: Context, listener: DSAuthenticationListener)

Karthikrajt commented 3 years ago

Thanks for your response. Do we have any sample code for getting an auth token from the android application?

skongara commented 3 years ago

@Karthikrajt Below is the code to get the access token with Authorization Code Grant: 1) Get the OAuth Client Id/Integration key, secret key and redirectUri from your account. (Please refer to https://developers.docusign.com/platform/auth/authcode/authcode-get-token/ on how to retrieve the clientId, secretKey and redirectUri from your account). 2) While initializing the DocuSign SDk, pass these values as shown in below DocuSign.init( context, clientId, secretKey, redirectUri, DSMode.DEBUG ).setEnvironment(environment)

3) Then you can call login method on authenticationDelegate as show in in below code.

DSAuthenticationDelegate authenticationDelegate = DocuSign.getInstance().getAuthenticationDelegate(); authenticationDelegate.login(REQUEST_LOGIN, this, new DSAuthenticationListener() { } 4) This will open the OAuth login screen. Enter your username and password and you should be able to login.