Spring Security 启动内置ldap服务器源码(一)

    xiaoxiao2021-03-25  210

    做个记录。 源码

    源码位于:org.springframework.security.config.annotation.authentication.configurers.ldap; class: LdapAuthenticationProviderConfigurer

    debug

    调试的时候特意注意了一下前后的端口占用情况postProcess(contextSource)前 控制台 10:47:58.003 INFO o.s.s.l.DefaultSpringSecurityContextSource - URL ‘ldap://127.0.0.1:33389/dc=springframework,dc=org’, root DN is ‘dc=springframework,dc=org’ 0.0.0.0:135 0.0.0.0:445 0.0.0.0:3306 0.0.0.0:3389 0.0.0.0:8081 0.0.0.0:49152 0.0.0.0:49153 postProcess(contextSource)后 控制台 10:49:20.617 INFO o.a.directory.server.ldap.LdapServer - Successful bind of an LDAP Service (33389) is completed. 10:49:20.618 INFO o.a.directory.server.ldap.LdapServer - Ldap service started. 0.0.0.0:135 0.0.0.0:445 0.0.0.0:3306 0.0.0.0:3389 0.0.0.0:8081 0.0.0.0:33389 0.0.0.0:49152 还有一个需要注意的点先记一下: 这里使用了defaultSpringSecurityContextSource(extends LdapContextSource) 在其构造方法中调用setpooled(true);默认情况是setPooled(false),在该方法的描述上也不推荐开启这个flag,而是推荐使用Spring LDAP PoolingContextSource. 原话: Set whether the pooling flag should be set, enabling the built-in LDAP connection pooling. Default is false. The built-in LDAP connection pooling suffers from a number of deficiencies, e.g. no connection validation. Also, enabling this flag when using TLS connections will explicitly not work. Consider using the Spring LDAP PoolingContextSource as an alternative instead of enabling this flag.

    转载请注明原文地址: https://ju.6miu.com/read-569.html

    最新回复(0)