Search in sources :

Example 1 with Person

use of org.springframework.security.ldap.userdetails.Person in project spring-security by spring-projects.

the class LdapUserServiceBeanDefinitionParserTests method personContextMapperIsSupported.

@Test
public void personContextMapperIsSupported() {
    setContext("<ldap-server ldif='classpath:test-server.ldif'/>" + "<ldap-user-service id='ldapUDS' user-search-filter='(uid={0})' user-details-class='person'/>");
    UserDetailsService uds = (UserDetailsService) appCtx.getBean("ldapUDS");
    UserDetails ben = uds.loadUserByUsername("ben");
    assertThat(ben instanceof Person).isTrue();
}
Also used : UserDetails(org.springframework.security.core.userdetails.UserDetails) UserDetailsService(org.springframework.security.core.userdetails.UserDetailsService) LdapUserDetailsService(org.springframework.security.ldap.userdetails.LdapUserDetailsService) Person(org.springframework.security.ldap.userdetails.Person) InetOrgPerson(org.springframework.security.ldap.userdetails.InetOrgPerson) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 UserDetails (org.springframework.security.core.userdetails.UserDetails)1 UserDetailsService (org.springframework.security.core.userdetails.UserDetailsService)1 InetOrgPerson (org.springframework.security.ldap.userdetails.InetOrgPerson)1 LdapUserDetailsService (org.springframework.security.ldap.userdetails.LdapUserDetailsService)1 Person (org.springframework.security.ldap.userdetails.Person)1