【发布时间】:2021-12-18 01:05:43
【问题描述】:
我正在尝试用 RestAuthentication (cas-server-support-rest-authentication) 替换 MongoAuthentication (cas-server-support-mongo)。以下是我目前取得的成就:
- 能够要求 CAS 调用我的外部 REST URI 来验证用户身份。
- 我的 REST URI 也能够根据 CAS 要求返回数据。这是我得到的日志。到这一步好像没问题。
[36m2021-12-18 00:19:18,155 DEBUG [org.apereo.cas.adaptors.rest.RestAuthenticationHandler]
- <REST authentication response received
[{"_class":"org.apereo.cas.authentication.principal.SimplePrincipal","id":"myemail@gmail.com","attributes":{}}]>
这是 CAS 抛出的错误
ERROR [org.apereo.cas.adaptors.rest.RestAuthenticationHandler]
- <Could not resolve subtype of [simple type, class org.apereo.cas.authentication.principal.Principal]:
missing type id property '@class'
我很确定我的 REST 响应有 id
return {
'@class': "org.apereo.cas.authentication.principal.SimplePrincipal",
'id': 'myemail@gmail.com',
'attributes': {}
}
我尝试了所有@class 或_class。他们两个都没有工作。
最后。卡斯说
Unable to detect the authentication principal for myemail@gmail.com
能否请您告知我忘记了什么?
谢谢, 广
【问题讨论】: