cas 入门之十二:cas 认证处理器-LDAP

本文介绍了CAS中FastBindLdapAuthenticationHandler和BindLdapAuthenticationHandler的认证逻辑,以及如何根据场景选择合适的处理器。FastBind直接用用户名和密码查询LDAP,而Bind则通过管理员账号初始化查询。为了提升性能,文章提出了使用PoolingContextSource对ContextSource进行池化,并详细给出了配置示例。此外,还讨论了当LDAP仅存储电子邮件作为用户名时,如何通过PrincipalNameTransformer优化用户体验。
摘要由CSDN通过智能技术生成
关于cas的ldap认证,可以参看
http://blog.163.com/magicc_love/blog/static/18585366220132294648822/
这篇文章对于如何配置ldap已介绍的算是比较全面了.
后面我主要描述一下这两个的认证逻辑.
org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler 认证逻辑是根据前台用户输入的
用户名与密码直接去查询是否有相应的用户存在,因为用户名/密码就是进入ldap服务器的通行证。所以在配置
ContextSource时可以不需要ldap服务器的管理员账号,但是它是每次认证都需要与ldap建立连接查询。
org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler 它的认证逻辑是根据前台用户输入的用户名(不包含密码)为条件,在ldap服务器
查询这个用户名的相关信息,返回一个集合,然后解析这个集合,逐个比对相应的密码如何匹配则认证成功,否则认证失败。在这个过程中,对于ContextSource的配置是需要ldap服务器的管理员账号,以满足初始查询。它的连接方式类似于数据库连接池。FastBindLdapAuthenticationHandler与BindLdapAuthenticationHandler
相比在性能方面,后者更占优势。但是当你应用第三方公司搭建的ldap服务器,而你又无法获取ldap服务器管理员的密码时,则FastBindLdapAuthenticationHandler就该上场了。
  为了更好的提高性能,我们也可以将contextSource进行池化,当然这个也只能在BindLdapAuthenticationHandler应用,配置如下:
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
移植curl但是zlib无法使能,如何解决该问题 Host setup: arm-unknown-linux-gnueabihf Install prefix: /opt/rootfs/curl-7.79.0/curl-7.79.0/_install Compiler: arm-linux-gnueabihf-gcc CFLAGS: -Werror-implicit-function-declaration -O2 -Wno-system-headers -pthread CPPFLAGS: -isystem /opt/rootfs/openssl-1.1.1/openssl-1.1.1/_install/include LDFLAGS: -L/opt/rootfs/openssl-1.1.1/openssl-1.1.1/_install/lib LIBS: -lssl -lcrypto -ldl -lpthread curl version: 7.79.0 SSL: enabled (OpenSSL) SSH: no (--with-{libssh,libssh2}) zlib: no (--with-zlib) brotli: no (--with-brotli) zstd: no (--with-zstd) GSS-API: no (--with-gssapi) GSASL: no (libgsasl not found) TLS-SRP: enabled resolver: POSIX threaded IPv6: enabled Unix sockets: enabled IDN: no (--with-{libidn2,winidn}) Build libcurl: Shared=yes, Static=yes Built-in manual: enabled --libcurl option: enabled (--disable-libcurl-option) Verbose errors: enabled (--disable-verbose) Code coverage: disabled SSPI: no (--enable-sspi) ca cert bundle: no ca cert path: no ca fallback: no LDAP: no (--enable-ldap / --with-ldap-lib / --with-lber-lib) LDAPS: no (--enable-ldaps) RTSP: enabled RTMP: no (--with-librtmp) PSL: no (libpsl not found) Alt-svc: enabled (--disable-alt-svc) HSTS: enabled (--disable-hsts) HTTP1: enabled (internal) HTTP2: no (--with-nghttp2, --with-hyper) HTTP3: no (--with-ngtcp2, --with-quiche) ECH: no (--enable-ech) Protocols: DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS MQTT POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP Features: AsynchDNS HSTS HTTPS-proxy IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets alt-svc
06-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值