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

做个记录。
源码
源码

源码位于: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.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值