我们如何使用Docusign Android SDK方法或其他方式跳过登录或隐式验证? [英] How can we skip the login or authenticate implicitly using the Docusign Android SDK methods or some other way?

查看:77
本文介绍了我们如何使用Docusign Android SDK方法或其他方式跳过登录或隐式验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将docuSign Android SDK集成到我的应用程序中,并且能够实现嵌入式签名.但是它要求客户在签署文档之前先登录.作为面向客户的应用程序,我们不希望他们输入组织的客户凭证.我们如何使用SDK方法或其他方式跳过登录或隐式验证?

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?

先谢谢了!

推荐答案

在Android SDK中,我们提供了以下API进行登录或身份验证.

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

  1. 使用访问令牌登录:

  1. Login with Access Token:

您可以调用以下SDK API:

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.按照 https://developers所述的步骤使用JWT Grant身份验证.docusign.com/platform/auth/jwt/jwt-get-token/

b.通过执行 https://developers中提到的步骤来使用授权代码授予.docusign.com/platform/auth/authcode/authcode-get-token/

需要在后端实现使用JWT Grant身份验证来获取访问令牌,并且一旦您的服务器使用这种方法从DocuSign接收到访问令牌,那么您的服务器就需要将该访问令牌和到期时间传递给您的应用和您的应用可以使用访问令牌和到期时间来调用上述Android SDK登录api.

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.

使用OAuth登录:

UI.从您的帐户中获取OAuth客户端ID/集成密钥,秘密密钥和redirectUri.(请参阅 https://developers.docusign.com/platform/auth/authcode/authcode-get-token/关于如何从您的帐户中检索clientId,secretKey和redirectUri).

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).

在初始化DocuSign SDk时,如下所示传递这些值

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() {
}

这将打开OAuth登录屏幕.输入您的用户名和密码,您应该可以登录.

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

在您的用例中,您可以使用SDK使用访问令牌登录"方法.

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

这篇关于我们如何使用Docusign Android SDK方法或其他方式跳过登录或隐式验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆