前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Docusign如何取得附有授权码授予的访问令牌

Docusign如何取得附有授权码授予的访问令牌

作者头像
用户9857551
发布2024-01-10 10:37:56
1470
发布2024-01-10 10:37:56
举报
文章被收录于专栏:Angular学习规划Angular学习规划

查询表索引

  • 查询表索引
  • Docusign:How to get an access token with Authorization Code Grant如何取得附有授权码授予的访问令牌
    • 手动获取
      • 标题Prerequisites 先决条件
      • 获取授权码:
    • 获取访问令牌
    • 标题获取访问令牌 包含以下字段

Docusign:How to get an access token with Authorization Code Grant如何取得附有授权码授予的访问令牌

手动获取

标题Prerequisites 先决条件

Data element 数据元素

Description 描述

You have defined an integration key.您已经定义了一个集成键。

An integration key identifies your integration and links to its configuration values. Create an integration key.集成键标识集成并链接到其配置值。创建一个集成键。

You have defined a redirect URI for your integration key.您已经为集成键定义了一个重定向URI。

The redirect URI is the URI (URL) to which DocuSign will redirect the browser after authentication. Set a redirect URI.重定向URI是DocuSign在身份验证后将浏览器重定向到的URI (URL)。设置一个重定向URI。

Your application has a secret key.您的应用程序有一个密钥。

Add a secret key. 添加密钥。

获取授权码:
  • 对于开发人员环境,基本URI为 https://account-d.docusign.com/oauth/auth
  • 对于生产环境,基本URI为https://account.docusign.com/oauth/auth
  • code 的 response_type 值,表示您的应用程序正在使用授权码授予。
代码语言:javascript
复制
https://account-d.docusign.com/oauth/auth?
   response_type=code
   &scope=YOUR_REQUESTED_SCOPES
   &client_id=YOUR_INTEGRATION_KEY
   &redirect_uri=YOUR_REDIRECT_URI

注意:授权码仅在两分钟内有效。如果从获取授权码到尝试将其交换为访问令牌之间的时间超过两分钟,则操作将失败。

获取访问令牌

代码语言:javascript
复制
curl --header "Authorization: Basic BASE64_COMBINATION_OF_INTEGRATION_AND_SECRET_KEYS"
--data "grant_type=authorization_code&code=YOUR_AUTHORIZATION_CODE"
--request POST https://account-d.docusign.com/oauth/token

Authorization 授权

The Authorization header contains your integration key and secret key, concatenated by a colon character, converted into base64, and prefixed with the word Basic. This value, together with the authorization code, is required to obtain an access token.

For example, if your integration key is 例如,如果您的集成键是

7c2b8d7e-xxxx-xxxx-xxxx-cda8a50dd73f and the secret key is 秘密的钥匙是 d7014634-xxxx-xxxx-xxxx-6842b7aa8861 you can get the base64 value in a JavaScript console with the following method call: 你可以在JavaScript控制台中使用以下方法调用获取base64值:

btoa(‘7c2b8d7e-xxxx-xxxx-xxxx-cda8a50dd73f:d7014634-xxxx-xxxx-xxxx-6842b7aa8861’)

这个方法调用会产生一个新的授权头值: NWMyYjhkN2…hODg2MQ== Authorization头包含集成密钥和秘密密钥,由冒号字符连接,转换为base64,并以 Basic 作为前缀。获取访问令牌需要此值和授权码。

标题获取访问令牌 包含以下字段

name

value

access_token

访问令牌的值。这个值将被添加到所有DocuSign API调用的 Authorization 头中。

token_type

令牌类型。对于访问令牌,this的值将为 Bearer 。

refresh_token

可用于获取新访问令牌而无需用户同意的令牌。刷新令牌的生命周期(通常在30天左右)可以根据业务需求而变化,并且可以随时更改。当您使用刷新令牌进行身份验证时,您可以通过以下行为获得新的刷新令牌:

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2024-01-09,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 查询表索引
  • Docusign:How to get an access token with Authorization Code Grant如何取得附有授权码授予的访问令牌
    • 手动获取
      • 标题Prerequisites 先决条件
      • 获取授权码:
    • 获取访问令牌
      • 标题获取访问令牌 包含以下字段
      相关产品与服务
      多因子身份认证
      多因子身份认证(Multi-factor Authentication Service,MFAS)的目的是建立一个多层次的防御体系,通过结合两种或三种认证因子(基于记忆的/基于持有物的/基于生物特征的认证因子)验证访问者的身份,使系统或资源更加安全。攻击者即使破解单一因子(如口令、人脸),应用的安全依然可以得到保障。
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档