我正在嘗試用 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":"[email protected]","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': '[email protected]',
'attributes': {}
}
我嘗試了所有@class或_class。他們兩個都沒有作業。
最后。卡斯說
Unable to detect the authentication principal for [email protected]
你能告訴我忘記了什么嗎?
謝謝,廣
uj5u.com熱心網友回復:
我不懂java,我有同樣的問題,我只是使用錯誤日志并閱讀檔案嘗試,也許json可以幫助您
{
"@class": "org.apereo.cas.authentication.principal.SimplePrincipal",
"id": "abc",
"attributes": {
"@class": "java.util.LinkedHashMap",
"username": [
"java.util.List",
["jackson"]
]
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/387672.html
