Got it working by defining my own EchoingPrincipalResolver and registering 
it. 
Documentation ...

On Thursday, September 14, 2017 at 10:45:50 AM UTC+3, Priit Serk wrote:
>
> CAS 5
>
> Handler:
>
> @Override
> protected HandlerResult doAuthentication(Credential credential) throws 
> GeneralSecurityException, PreventedException {
>    final Map<String, Object> attributeMap = 
> fillAttributes((UsernamePasswordCredential) credential);
>
>    attributeMap.put("name", "Test attribute value");
>          final List<MessageDescriptor> list = new ArrayList<>();
>    return createHandlerResult(credential,
>          this.principalFactory.createPrincipal(((UsernamePasswordCredential) 
> credential).getPersonalCode(),
>                attributeMap),
>          list);
>
>
> Service:
>
> "scopes": [
>    "java.util.HashSet", [ "openid",  "profile" ]
>    
> ],
> "attributeReleasePolicy": {
>    "@class": "org.apereo.cas.services.ReturnAllowedAttributeReleasePolicy",
>    "allowedAttributes" : [ "java.util.ArrayList", [ "name" ] ]
> }
>
>
>
> OAuth20UserProfileControllerController (profile request):
>
>    accessToken.getAuthentication().getPrincipal();
>
>    principal.getAttributes()
>
> Principal = instanceOf SimplePrincipal, but previously added attribute is not 
> there. 
>
> Trying to debug through the code to understand how it actually works, but no 
> luck till now.
>
>

-- 
- 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/6eefb83a-4586-4b8c-9e49-1efa3b1fbf1e%40apereo.org.

Reply via email to