Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have integrated the docuSign Android SDK in my app and been able to achieve embedded signing. But it asks for the customer to login before signing the document. As its a customer facing app, we dont want them to enter the organisation docusign credentials. How can we skip the login or authenticate implicitly using the SDK methods or some other way?

Thanks in Advance!!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
884 views
Welcome To Ask or Share your Answers For Others

1 Answer

In Android SDK, we provide the following apis to login or authenticate.

  1. Login with Access Token:

    You can invoke the following SDK API:

    // accessToken - Access Token which authenticates the user
    // refreshToken - If the access token can be refreshed, the refresh token. Optional
    // expiresIn - The number of seconds from the time the access token was provisioned to when it will expire
    try {
     DSAuthenticationDelegate docusignAuthDelegate = DocuSign.getInstance().getAuthenticationDelegate();
     docusignAuthDelegate.login(accessToken, refreshToken, expiresIn, context,
         new DSAuthenticationListener() {
             @Override
             public void onSuccess(@NonNull DSUser user) {
                 // TODO: handle successful authentication here
             }
    
             @Override
             public void onError(@NonNull DSAuthenticationException exception) {
                 // TODO: handle authentication failure here
             }
         }
     );
    } catch (DocuSignNotInitializedException exception) {
     // TODO: handle error. This means the SDK object was not properly initialized
    }
    

    You can retrieve access token the following ways:

    a. Using JWT Grant authentication by following steps mentioned at https://developers.docusign.com/platform/auth/jwt/jwt-get-token/

    b. Using Authorization Code Grant by following the steps mentioned at https://developers.docusign.com/platform/auth/authcode/authcode-get-token/

    Using JWT Grant authentication to fetch access token needs to be implemented at your backend and once your server receives access token from DocuSign using this approach, then your server needs to pass that access token and the expiration time to your app and your app can invoke the above mentioned Android SDK login api with access token and expiration time.

  2. Login using OAuth:

    UI is displayed where user enters credentials. 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).

    While initializing the DocuSign SDk, pass these values as shown in below

     DocuSign.init(
     context,
     clientId,
     secretKey,
     redirectUri,
     DSMode.DEBUG
    ).setEnvironment(environment)
    
    DSAuthenticationDelegate authenticationDelegate = DocuSign.getInstance().getAuthenticationDelegate();
    authenticationDelegate.login(REQUEST_LOGIN, this, new DSAuthenticationListener() {
    }
    

    This will open the OAuth login screen. Enter your username and password and you should be able to login.

In your use case, you can use SDK 'Login with Access Token' approach.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...