angular - DocuSign:对于 Angular 应用程序 - 为什么 OAuth 重定向 URL 不能包含片段指示符 (#)?
问题描述
我有一个前端应用程序,其 url 看起来像http://localhost:4200/#/dashboard
-> 完成身份验证后,这也应该称为重定向 url。不幸的是,当应用程序重定向到 DocuSign 登录页面时,我注意到 # 之后的重定向 url 部分被切断了。它是一个错误吗?我怎么能省略它?
在 DocuSign 面板中,我将重定向 url 设置为:http://localhost:4200/#/dashboard
重定向到 DocuSign 以登录的我的 url 看起来像:
https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature&client_id={integrator_key}&redirect_uri=http://localhost:4200/#/dashboard
DocuSign 构造的 url(包括重定向 url)看起来像:
https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature&client_id={integrator_key}&redirect_uri=http://localhost:4200/piggyagent#/username
没有东西之后#
结束The provided customer ID is not registered in the DocuSign service.
解决方案
根据您可以在此处找到的 oauth v2 规范,这是不允许的 - https://www.oauth.com/oauth2-servers/redirect-uris/redirect-uri-registration/表示“注册的重定向 URL 可能包含查询字符串参数, 但不能在片段中包含任何内容。如果开发人员尝试注册包含片段的重定向 URL,则注册服务器应拒绝该请求。”
您可以使用状态来传递信息并在代码的另一端再次重定向。
推荐阅读
- c - 无法运行使用 clang/lld/mingw 编译的 Windows 二进制文件
- .htaccess - 使用 .htaccess 重定向子域
- jenkins - Jenkins管道,如何将工件从以前的构建复制到当前构建?
- ruby-on-rails - 如何修复“Sprockets::FileNotFound: 找不到类型为 'application/javascript' 的文件 'turbolinks'”
- python - 如何在 PyQt 中创建一个类似于 messageBox 的窗口
- javascript - Vue.js open link in new window
- html - 像 Whatsapp 一样,如何在您键入时进行向上延伸的输入?
- tizen - Tizen Web SDK:如何远程调试(Web 检查器)在手表(Galaxy)上运行的 Web 应用程序?
- c - strcmp 的段错误
- android - 我垂直分配底部的 StackLayout 下面有一个间隙?