当前位置: 首页 > 知识库问答 >
问题:

Spring security 3.1版本,需要匹配的用户

卜鹏
2023-03-14

所有人,

我们的IT部门已决定更改广告中用户的后缀,将广告中的userPrincipalName添加到实际使用的域名中。

如我们的域名是xxx.com但userPrincipalName我

Spring LDAP AD身份验证不再适用于此,我认为是因为这个原因:userPrincipalName在尝试进行身份验证时是使用域名构建的。

我需要重写这个不知何故,但保持与Sp

这是我们使用的安全豆

<bean id="ldapActiveDirectoryAuthProvider" class="org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider">
    <constructor-arg value="$websec{authentication.base}" />
    <constructor-arg value="$websec{ldap.providerUrl}" />
    <property name="authoritiesMapper" ref="dataAutomationGrantedAuthoritiesMapper" />
    <property name="useAuthenticationRequestCredentials" value="true" />
</bean>

我怎样才能克服这种行为?

谢谢

共有1个答案

闾丘山
2023-03-14

我们最终修改了该类的原始Spring代码:ActiveDirectoryLdapAuthenticationProvider,并更改了创建BindPrincipal的方法,以允许与安全根域具有不同域的用户PrincipalName获得授权。

/**
 * Create bind principal by appending configured user domain to username if it doesn't already contain a domain.
 *
 * @param username  User name for which to create bind principal.
 *
 * @return username, if configured domain is null or the username already contains a domain; otherwise username
 *         appended with the configured user domain.
 */
String createBindPrincipal(final String username) {
    if (domain == null || username.contains("@")) {
        return username;
    }
    return username + "@" + userDomain;
}
 类似资料:
  • 我在google Play上发布了我的应用程序测试版。 但在清单中指定了另一个版本: 还有人遇到过这个问题吗?会是什么?

  • 我有这个错误:

  • 假设我的客户支持TLS V1。0,1.1和1.2。远程站点支持TLS V1。0和1.1。双方都支持相同的密码。 我的问题是: 1-据我所知,我将始终使用我现有的最高TLS版本启动通信。在这种情况下,我将如何与另一边联系? 2-以下是客户端和服务器之间的Wireshark客户端HELLO捕获,如上所述。 这种连接尝试最终导致“无法创建SSL/TLS安全通道”。我怀疑这与“TLSV1.1记录层”和“版

  • 我目前在tensorflow中使用RNN时遇到了这个错误: 这个程序需要协议缓冲区运行库的3.3.0版本,但是安装的版本是2.6.1。请更新您的库。如果您自己编译程序,请确保您的标头来自与链接时库相同的协议缓冲区版本。(版本验证失败在"bazel-out/local_linux-opt/genfile/tenorflow/contrib/tensor_forest/proto/fertile_st

  • 问题内容: 我想匹配一个看起来像这样的字符串: 如果存在lang_tags不包含的文本(在本示例中为),我希望匹配返回true 。也可以将其放置在字符串的开头或结尾。 空格不应匹配,例如不应导致匹配。 我不能使用超前或回溯,因为MySQL似乎不支持此功能。 有什么建议? 问题答案: 试试这个正则表达式: 这是您可以使用的方式: 它应该处理所有情况: 前 后 中间 不是空格

  • 问题内容: 在PHP中,每当尝试连接到数据库时,都会收到以下警告(通过) 警告:mysql_connect():标头和客户端库次要版本不匹配。标头:50162图书馆:50524 在我的输出中,我在mysqli下列出了以下值 客户端API库版本=> 5.5.24 客户端API标头版本=> 5.1.62 我已经尝试更新php5-mysql 和 php,但是我已经拥有了两者的最新版本。我该如何更新标头版