I am trying to replace MongoAuthentication (cas-server-support-mongo) with RestAuthentication (cas-server-support-rest-authentication). Here are what I achieved so far:
- Be able to ask CAS call to my external REST URI to authenticate the user.
- My REST URI is also be able to return data as CAS required. Here is the log I got. It seems to be OK at this step.
[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":{}}]>
Here is the error CAS threw
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'
I am pretty sure that my REST response has id
return {
'@class': "org.apereo.cas.authentication.principal.SimplePrincipal",
'id': 'myemail@gmail.com',
'attributes': {}
}
I tried all @class or _class. Both of them didn't work at all.
Finally. Cas said
Unable to detect the authentication principal for myemail@gmail.com
Could you please kindly advise what I forgot?
THanks, Quang