Why OAuth user profile return fields as arrays?
{  
   "number":[  
      "1234"
   ],
   "fullname": [
       "John Smith"
   ],
   "email":[  
      "[email protected]"
   ],
   "sso_id":[  
      "5d0364ef4fd1c900075487f0"
   ],
   "service":"https://url.com/redirect";,
   "id":"[email protected]",
   "client_id":"secret"
}

I want to response without arrays:

{  
   "number": "1234",
   "fullname": "John Smith",
   "email": "[email protected]",
   "sso_id": "5d0364ef4fd1c900075487f0",
   "service":"https://url.com/redirect";,
   "id":"[email protected]",
   "client_id":"secret"
}

I tested this on CAS 6.1.0.RC5 and 6.0.4 version.
I used MongoDb, in Mongo all fields have proper types.

*cas.properties*
cas.authn.mongo.attributes=number,id,email,fullname
cas.authn.oauth.userProfileViewType=FLAT
...

*Service configuration*
{
  "@class" : "org.apereo.cas.support.oauth.services.OAuthRegisteredService",
  "clientId": "clientid",
  "clientSecret": "clientsecret",
  "serviceId" : ".*example.com/.*",
  "name" : "ClientName",
  "id" : 1000,
  "bypassApprovalPrompt": true,
  "generateRefreshToken": true,
  "supportedGrantTypes": [ "java.util.HashSet", [ "authorization_code" ] ],
  "supportedResponseTypes": [ "java.util.HashSet", [ "code" ] ],
  "attributeReleasePolicy" : {
    "@class" : "org.apereo.cas.services.ReturnAllAttributeReleasePolicy"
  },
  "scopes": [ "java.util.HashSet", ["profile"]]
}


-- 
- 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/3b060d49-8247-4f8c-a950-35325f5609fb%40apereo.org.

Reply via email to