docusignapi - 如何在 DocuSign 中使用刷新令牌
问题描述
我正在使用 docusign 身份验证流程作为
登录
时让 url = "https://account-d.docusign.com/oauth/auth?response_type=token&scope=signature extended&client_id=39b5f6fb-97ca-XXXXXXXXXXXXX&state=a39fh23hnf23XXXXXX&redirect_uri=http://localhost:4200/callbackdocusign";
window.open(url, '_self'); 成功验证后返回 access_token/expires_in/token_type/state。
请指导如何获得refresh_token?refresh_token 后如何获取新的 access_token?
对于 refresh_token 我尝试了 let url = "https://account-d.docusign.com/oauth/auth?response_type=refresh_token&scope=signature extended&client_id=39b5f6fb-97ca-XXXXXXXXXXXXX&state=a39fh23hnf23XXXXXX&redirect_uri=http://localhost:4200/callbackdocusign" ; window.open(url, '_self');
但它没有返回 refresh_token
解决方案
您使用的 URL 具有response_type=token
. 此响应类型用于隐式授权身份验证,不支持刷新令牌。如果您需要刷新令牌,则必须使用授权代码授予。您的网址看起来像这样
https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature extended&client_id=39b5f6fb-97ca-XXXXXXXXXXXXX&state=a39fh23hnf23XXXXX&redirect_uri=http://localhost:4200/callbackdocusign
当您的用户在身份验证后被重定向时,这将在 URL 中提供一个“代码”参数。您可以使用该代码来获取实际的访问和刷新令牌。
你可以在这里找到完整的解释: https ://developers.docusign.com/platform/auth/authcode/authcode-get-token/
推荐阅读
- ios - UIPickerView 报告错误的行
- android - ListView with Checkboxes:如何检查它是否被选中?
- c# - 在更改组合框时填充 ListView - 正确的 MVVM 实现
- gluon - gluon-mobile 插件无法处理多版本 jar
- java - 使用 JAXB Marshaller 构建的 StringWrite 在使用 POSTMAN 查看时显示“<”而不是“<”
- android - FCM Push 在 Android 8.0、Oreo 上不起作用
- reactjs - ./src/index.js 中的错误模块解析失败:意外令牌 (13:16) 您可能需要适当的加载程序来处理此文件类型
- javascript - Jasmine 测试不会创建类的新实例
- c - 这是语法正确的 C 代码吗?
- npm - 安装第三方 js 库会弄乱 jhipster 项目中现有的 node_modules