外部服务的 CAS 6.4 REST 身份验证 - 缺少类型 ID 属性 '@class'

CAS 6.4 REST Authentication to External Service - Missing type id property '@class'

我正在尝试用 RestAuthentication (cas-server-support-rest-authentication) 替换 MongoAuthentication (cas-server-support-mongo)。以下是我到目前为止取得的成就:

[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

你能告诉我我忘记了什么吗?

谢谢, 广

我不明白java,我也有同样的问题,我只是使用错误日志和阅读文档来尝试,也许json可以帮助你

{
"@class": "org.apereo.cas.authentication.principal.SimplePrincipal",
"id": "abc",
"attributes": {
    "@class": "java.util.LinkedHashMap",
    "username": [
        "java.util.List",
        ["jackson"]
    ]
 }
}