Dear all,
I have succeed config Oauth 2.0 feature in CAS version 6.2.x.
I can get JWT token from CAS.
Here is my service Oauth 2.0 configuration:
{
"@class" : "org.apereo.cas.support.oauth.services.
OAuthRegisteredService",
"clientId": "xxxx",
"clientSecret": "xxx",
"generateRefreshToken" : true,
"jsonFormat" : true,
"supported_grants" : ["password", "refresh_token"],
"serviceId" : "^https://xxxxx/.*",
"name" : "OAuthJWTService",
"id" : 3,
"jwtAccessToken": true,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ReturnAllowedAttributeReleaseP
olicy",
"allowedAttributes" : [ "java.util.ArrayList",
["comdepartment","comid","lastname","usercode","userdate","useremail","
userparentid","userstatus","usertel","usertype","userid" ] ]
}
}
And this is my user registry (stored in MongoDB)
{
"username": "user_anonymous_1",
"password": "123456",
"lastname": "user_anonymous_1",
"useremail": "[email protected]",
"usertel": "0907888512",
"userdate": "2020-07-02",
"userstatus": "ACTIVE",
"userparentid": "VNPTIT2",
"comid": "VNPTIT2",
"comdepartment": "GP2",
"usercode": "user_anonymous_1",
"usertype": "USER_COM"
}
With this configuration, when I get Oauth 2.0 JWT token, CAS will return me
attributes as json with one level.
Now, I want to configure my CAS server return return attributed as JSON
multi-level
For example like this:
{ "attributes":{ "comdepartment":"GP2", "comid":"VNPTIT2", "lastname":"
user_anonymous_1 ", "usercode":" user_anonymous_1 ", "userdate":"09-11-2020"
, "useremail":" [email protected]", "userparentid":"VNPTIT2",
"userstatus":"ACTIVE", "usertel":"0907888511", "usertype":"USER_COM",
"userid":"", "roles":"", "service":"", "organization":{ "organ1":"ACTIVE",
"organ2":"ACTIVE", "organ3":"DISABLE" } }}
Thank you.
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/f0173c36-94c3-4b17-aafe-7f70fdc2196an%40apereo.org.