spring-projects / spring-ldap

Spring LDAP
https://spring.io/spring-ldap
Apache License 2.0
347 stars 482 forks source link

spring-data-ldap @DnAttribute value is not work #490

Open chc123456 opened 6 years ago

chc123456 commented 6 years ago

Setting “value” has no effect, when I set the value like @DnAttribute(value = "ou", index = 3) this is not index by "ou" attribute.It works the whole "dn"

rwinch commented 6 years ago

@chc123456 Thank you for the report! Would you be able to submit an example or a PR with a test to fix it?

chc123456 commented 6 years ago

Use user-admin-sample data like

dn: cn=Some Dude,ou=Development,ou=IT,ou=Departments,dc=example,dc=com

Entity Like

    @DnAttribute(value = "ou", index = 3)
    @Transient
    private String unit;

    @DnAttribute(value = "ou", index = 2)
    @Transient
    private String department;

Change Index Number.

   @DnAttribute(value = "ou", index = 5)
    @Transient
    private String department;

getDepartment() value is “Some Dude”

rwinch commented 6 years ago

Any chance you can provide a complete sample? If you are able to, this will greatly speed up the ability for me to respond since I have lots of other users asking for help.

chc123456 commented 6 years ago

@rwinch
https://github.com/chc123456/springboot-ldap-simple

rwinch commented 6 years ago

Thanks for the sample @chc123456 I have added this to my queue