Hi
I am using CAS Overlay Template version 6.2.x.
I have configured my Oauth 2.0 service like bellow:

1. My Oauth2.0 service config

{

    "@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" ] ]

     },

    "properties" : {

      .....

}

2. My CAS authentication attributes config (stored in MongoDB)

{
    "_id": {
        "$oid": "5e72d2e643777507d8d31f80"
    },
    "name": "cas.authn.mongo.attributes",
    "value": 
"comdepartment,comid,lastname,usercode,userdate,useremail,userparentid,userstatus,usertel,usertype"
}

3. My register user (stored in MongoDB) 

{
    "_id": {
        "$oid": "5efd3679c890ce09f4f150b9"
    },
    "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, how c-an I config my service to get return attributed as JSON 
multi-level?

For example: multi-level in attributes "organization"
{
   "service":"exampleOauthClient",
   "attributes":{
      "data":{
         "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",
         "organization":{
            "organ1":"ACTIVE",
            "organ2":"ACTIVE",
            "organ3":"DISABLE"
         }
      }
   },
   "id":"[email protected]",
   "client_id":"exampleOauthClient"
}

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/36bf798f-813c-4ae5-8396-4bf037d8360an%40apereo.org.

Reply via email to