简体   繁体   English

Apereo CAS 代理身份验证与 REST api

[英]Apereo CAS surrogate authentication with REST api

I'm successfully using Apereo 6.0.7 to authenticate my users via web login and JWT.我成功地使用 Apereo 6.0.7 通过网络登录和 JWT 对我的用户进行身份验证。 I've also implemented delegate authentication to impersonate a given regular user with an admin profile.我还实现了委托身份验证,以使用管理员配置文件模拟给定的普通用户。
Now I'd like to do the same procedure via Apereo REST API.现在我想通过 Apereo REST API 执行相同的过程。 I've successfully configured these API to authenticate a user with username and password.我已成功配置这些 API 以使用用户名和密码对用户进行身份验证。 For example (via curl):例如(通过 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'

However I'm not able yet to perform a surrogate login.但是,我还不能执行代理登录。 Using the configured separator to provide username adn surrogate doesn't work.使用配置的分隔符提供用户名和代理不起作用。 For example, with / as separator (encoded as %2F):例如,以 / 作为分隔符(编码为 %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'

returns 401. Can anybody help me finding what's missing?返回 401。有人可以帮我找到丢失的东西吗? Thank you.谢谢你。

I've found the answer.我找到了答案。 Surrogate support for API REST has been introduced in version 6.2.0 6.2.0 版本中引入了对 API REST 的代理支持

https://github.com/apereo/cas/commit/678d78dba004289a93466cbec9d28bcae7d57a14 https://github.com/apereo/cas/commit/678d78dba004289a93466cbec9d28bcae7d57a14

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM