*complement*:

Client side i use spring security and i try to get attribute this way:

      Authentication auth = 
SecurityContextHolder.getContext().getAuthentication();
      if( auth != null 
      && auth.getPrincipal() != null
      && auth.getPrincipal() instanceof UserDetails) {
      
      
    UserDetails user = (UserDetails) auth.getPrincipal();




Le mercredi 10 janvier 2018 15:11:28 UTC+1, Sébastien Ragons a écrit :
>
> Hello,
>
> I am trying to get attribute from LDAP but with no success since days.
> So i tried a basic configuration but it doesnt work.
>
> My basic configuration:
> # Authentification LDAP
> cas.authn.ldap[0].type=AUTHENTICATED
> cas.authn.ldap[0].ldapUrl=ldap://frparantgaga:389/
> cas.authn.ldap[0].useSsl=false
> cas.authn.ldap[0].useStartTls=false
> cas.authn.ldap[0].connectTimeout=5000
> cas.authn.ldap[0].baseDn=o=antalis
> cas.authn.ldap[0].userFilter=(|(uid={user})(mail={user}))
> cas.authn.ldap[0].subtreeSearch=true
> cas.authn.ldap[0].usePasswordPolicy=true
>
> # Credential to connect to LDAP
> cas.authn.ldap[0].bindDn=cn=root,o=antalis
> cas.authn.ldap[0].bindCredential=passwd
>
> # authentication-attributes
> cas.authn.ldap[0].principalAttributeList=sn,cn,mail,description
> cas.authn.attributeRepository.attributes.sn=sn
> cas.authn.attributeRepository.attributes.cn=cn
> cas.authn.attributeRepository.attributes.mail=mail
> cas.authn.attributeRepository.attributes.description=description 
>
>
> I configured my service to get all attributes
> {
>   "@class" : "org.apereo.cas.services.RegexRegisteredService",
>   "serviceId" : ".*",
>   "name" : "Service 3 avec theme 2",
>   "theme" : "theme2",
>   "id" : 3,
>   "attributeReleasePolicy" : {
>     "@class" : "org.apereo.cas.services.ReturnAllAttributeReleasePolicy"
>   }
> }
>
>
> Client side the principal doesnt contain none of the configured attributes.
> CAS server's logs seem to indicate that there is no attribute to release:
>
> .AbstractRegisteredServiceAttributeReleasePolicy] - <Found principal 
> attributes [{}] for [[email protected]]> 
>
>
>
> I'm aware about the article on the blog about attributes: 
> https://apereo.github.io/2017/02/22/cas51-dbauthn-tutorial/
> I've consulted several questions about this topic on this group.
> I dont understand why it doesnt work.
>
> Could you help me ?
> Thank you 
>
> Sebastien
>

-- 
- 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/5b1a744a-aecd-4c94-a444-027666772f5c%40apereo.org.

Reply via email to