Articles Simple Authentication SSL and StartTLS Spring-Security with LDAP物件關係 ActiveDirectoryLdapAuthenticationProvider Support SAM-Account-Name Support TLS LdapAuthenticationProvider 如何透過LDAP做認證? Support Secure connection Support StartTLS with anonymous login Search AD User and Groups LdapContextSource contextSource = new DefaultSpringSecurityContextSource ( "ldap://10.134.15.138:389" ) ; contextSource. setBase ( "DC=TEST,DC=SSM" ) ; contextSource. setUserDn ( "test@TEST.SSM" ) ; contextSource. setPassword ( "123456" ) ; DirContextAuthenticationStrategy strategy = createTLSStrategy ( ) ; contextSource. setAuthenticationStrategy ( strategy ) ; contextSource. afterPropertiesSet ( ) ; LdapTemplate ldapTemplate = new LdapTemplate ( contextSource ) ; ldapTemplate. afterPropertiesSet ( ) ; SearchControls sc = new SearchControls ( ) ; sc. setSearchScope ( SearchControls . SUBTREE_SCOPE ) ; ldapTemplate. search ( ...