gpt4 book ai didi

java - 在 weblogic 服务器上将 enforce-valid-basic-auth-credentials 设置为 false 会产生什么后果

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:24:07 25 4
gpt4 key购买 nike

在我的 weblogic 服务器中,我有启用了基本身份验证的应用程序(web.xmlweblogic.xml)。现在我正在将 spring-boot 应用程序从 tomcat 移植到 weblogic,weblogic 也是基本身份验证,但在应用程序层。因此,当我移植它时它不起作用,我需要将 enforce-valid-basic-auth-credentials 设置为 false。现在我希望我应该重构我在同一域上运行的第一个应用程序(它在虚拟主机上运行),但似乎身份验证仍在该应用程序中工作。那么,当我在生产服务器上设置此选项时会产生什么后果?

最佳答案

影响在哪里?

The enforce-valid-basic-auth-credentials flag effects the entire domain. So, it will work for both of your project.

默认情况下,enforce-valid-basic-auth-credentials 标志为 true,并执行 WebLogic Server 身份验证。如果身份验证失败,请求将被拒绝。因此,WebLogic Server 必须知道用户和密码。

如果您依赖备用身份验证机制,您可能想要更改默认行为。例如,您可以使用后端 Web 服务对客户端进行身份验证,而 WebLogic Server 不需要了解用户。启用默认身份验证实现后,Web 服务可以进行自己的身份验证,但前提是 WebLogic Server 身份验证首先成功。

如果您显式设置 enforce-valid-basic-auth-credentials标记为 false,WebLogic Server 不对目标资源未启用访问控制的 HTTP BASIC 身份验证客户端请求执行身份验证。

资源链接:

  1. Understanding BASIC Authentication with Unsecured Resources
  2. WebLogic bypass basic authentication

Oracle 对 enforce-valid-basic-auth-credentials 有何看法?

Oracle WebLogic Server authentication is enabled by default. However, this configuration prevents Oracle WebLogic Server from using application managed authentication. You must disable Oracle WebLogic Server authentication by setting the enforce-valid-basic-auth-credentials parameter to false.

Procedure

To disable Oracle WebLogic Server authentication:

  1. In a text editor, open the config.xml file for the domain where you deployed IBM CMIS for Content Manager OnDemand. The config.xml file is in the Oracle/Middleware/user_projects/domains/domain_name/config directory.
  2. Locate the <security-configuration> element.
  3. Add the following argument to the end of the element:

    <enforce-valid-basic-auth-credentials>false</enforce-valid-basic-auth
    -credentials>

  4. Start or restart all of the servers in the domain.

资源链接:

  1. Disabling Oracle WebLogic Server authentication for IBM CMIS forContent Manager OnDemand

更新#1:

为什么做成false?

Whether or not the system should allow requests with invalid Basic Authentication credentials to access unsecure resources. (Interface=weblogic.management.configuration.SecurityConfigurationMBean Attribute=getEnforceValidBasicAuthCredentials)

实际上,您需要在这里做两件事。

  1. 有时仅仅使它为假是不够的。
  2. 因此,您需要通过 WLST 添加标志:
connect('weblogicUser','weblogicPassword','t3://localhost:7001')
edit()
startEdit()
cd('SecurityConfiguration/Your_Domain')
set('EnforceValidBasicAuthCredentials','false')
save()
activate()

注意:(不要忘记在“cd”命令中使用您的 weblogicUser、weblogicPassword、weblogic url 和您的域进行编辑...)。如果你成功地完成了这些事情,那么它将影响你的配置文件。

决议:

重启服务器后,如果你查看config.xml文件,并添加了另一个标签。现在,config.xml文件看起来像这样:

.........
<enforce-valid-basic-auth-credentials>false</enforce-valid-basic-auth-credentials>
<use-kss-for-demo>true</use-kss-for-demo>
</security-configuration>
............

但是这个use-kss-for-demo标记可能取决于您的 weblogic 配置。所以Val Bonn强烈建议使用 WSLT 方式更新此标志。

资源链接:

https://stackoverflow.com/a/39619242/2293534


更新#2:

那么,您想知道影响是什么?

默认情况下,WebLogic Server 查看身份验证 header ,即使您的代码和应用程​​序设置为允许匿名访问,如果有任何 HTTP 身份验证 header ,WebLogic 也无法处理请求并抛出浏览器登录对话框:

enter image description here

Publisher Web 服务默认使用身份验证 header ,因此 Publisher 身份验证 header 会发送到您的 portlet 代码。幸运的是,对此的修复非常简单,并记录为将 enforce-valid-basic-auth-credentials 设置为 false。

资源链接:

  1. http://blog.integryst.com/webcenter-interaction/2010/03/24/setting-config-xml-for-weblogic-in-oracles-jdeveloper/

关于java - 在 weblogic 服务器上将 enforce-valid-basic-auth-credentials 设置为 false 会产生什么后果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40397917/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com