public class BasicUserDetailsContextMapper
extends java.lang.Object
implements org.springframework.security.ldap.userdetails.UserDetailsContextMapper
DirContextOperations
bean to a UserDetails
bean. The user data is simply retrieved by invoking the
configured UserDetailsService
with the given username. Conversion from
UserDetails
to a DirContextAdapter
is not supported.
Sample XML configuration:
<bean id="userDetailsContextMapper" class="com.appiancorp.suiteapi.common.spring.security.BasicUserDetailsContextMapper">
<constructor-arg ref="myUserDetailsService"/>
</bean>
<bean id="myUserDetailsService" class="com.example.security.auth.MyUserDetailsService"/>
Constructor and Description |
---|
BasicUserDetailsContextMapper(org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
Creates a new instance with the given
UserDetailsService which will be used to
retrieve the user data when
mapUserFromContext(DirContextOperations, String, Collection) is invoked. |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.security.core.userdetails.UserDetailsService |
getUserDetailsService() |
org.springframework.security.core.userdetails.UserDetails |
mapUserFromContext(org.springframework.ldap.core.DirContextOperations ctx,
java.lang.String username,
java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authority)
Invokes the
configured userDetailsService
with the given username. |
void |
mapUserToContext(org.springframework.security.core.userdetails.UserDetails user,
org.springframework.ldap.core.DirContextAdapter ctx)
Throws
UnsupportedOperationException . |
java.lang.String |
toString() |
public BasicUserDetailsContextMapper(org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
UserDetailsService
which will be used to
retrieve the user data when
mapUserFromContext(DirContextOperations, String, Collection)
is invoked.public org.springframework.security.core.userdetails.UserDetails mapUserFromContext(org.springframework.ldap.core.DirContextOperations ctx, java.lang.String username, java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authority)
configured userDetailsService
with the given username. The passed-in granted authorities are ignored and the ones set by
UserDetailsService
are used instead.mapUserFromContext
in interface org.springframework.security.ldap.userdetails.UserDetailsContextMapper
public void mapUserToContext(org.springframework.security.core.userdetails.UserDetails user, org.springframework.ldap.core.DirContextAdapter ctx)
UnsupportedOperationException
.mapUserToContext
in interface org.springframework.security.ldap.userdetails.UserDetailsContextMapper
protected org.springframework.security.core.userdetails.UserDetailsService getUserDetailsService()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2003-2024 Appian Corporation. All Rights Reserved.