java - 使用 REST api 的 Apereo CAS 代理身份验证
问题描述
我已成功使用 Apereo 6.0.7 通过 Web 登录和 JWT 对我的用户进行身份验证。我还实现了委托身份验证来模拟具有管理员配置文件的给定常规用户。
现在我想通过 Apereo REST API 执行相同的过程。我已成功配置这些 API 以使用用户名和密码对用户进行身份验证。例如(通过 curl):
curl -k -X POST \
https://local.host.it:8444/cas/v1/tickets/ \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'cache-control: no-cache' \
-d 'token=true&username=andrea&password=secretpswd'
但是我还不能执行代理登录。使用配置的分隔符提供用户名和代理不起作用。例如,使用 / 作为分隔符(编码为 %2F):
curl -k -X POST \
https://local.host.it:8444/cas/v1/tickets/ \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'cache-control: no-cache' \
-d 'token=true&username=andrea%2Fsurrogate&password=secretpswd'
返回 401。任何人都可以帮我找出丢失的东西吗?谢谢你。
解决方案
我找到了答案。6.2.0 版中引入了对 API REST 的代理支持
https://github.com/apereo/cas/commit/678d78dba004289a93466cbec9d28bcae7d57a14
推荐阅读
- vim - 如何使用 Vim 搜索查找以 4 个字符单词开头的行?
- r - 嗨,我坚持使用 Lahiri 绘制样本的方法
- linux - L2CAP 蓝牙:消息太长
- python - 如何在熊猫脚本中禁用舍入
- python - 如何在列表推导中进行扩展
- python - Django CookieCutter:django.db.utils.OperationalError:fe_sendauth:未提供密码
- javascript - 需要的建议:是否可以在一天中的某个时间更改文件路径以显示不同的内容?
- javascript - Discord.js 导入意图
- android - Android可以访问android中任何应用程序的应用内购买吗
- html - How to remove space between content and left border in p tag?