简体   繁体   中英

Apereo CAS surrogate authentication with REST api

I'm successfully using Apereo 6.0.7 to authenticate my users via web login and 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. I've successfully configured these API to authenticate a user with username and password. For example (via 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):

 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? Thank you.

I've found the answer. Surrogate support for API REST has been introduced in version 6.2.0

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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