oauth服务。
原本在tomcat下运行正常。
改用weblogic后无端的包401错误。
官方解决方案:https://docs.oracle.com/cd/E12840_01/wls/docs103/security/thin_client.html#understanding_basic_atn
Understanding BASIC Authentication with Unsecured Resources
For WebLogic Server versions 9.2 and later, client requests that use HTTP BASIC authentication must pass WebLogic Server authentication, even if access control is not enabled on the target resource.
The setting of the Security Configuration MBean flag enforce-valid-basic-auth-credentials determines this behavior. (The DomainMBean can return the new Security Configuration MBean for the domain.) It specifies whether or not the system should allow requests with invalid HTTP BASIC authentication credentials to access unsecured resources.
| Note: | The Security Configuration MBean provides domain-wide security configuration information. The enforce-valid-basic-auth-credentials flag effects the entire domain. |
The enforce-valid-basic-auth-credentials flag is true by default, and WebLogic Server authentication is performed. If authentication fails, the request is rejected. WebLogic Server must therefore have knowledge of the user and password.
You may want to change the default behavior if you rely on an alternate authentication mechanism. For example, you might use a backend web service to authenticate the client, and WebLogic Server does not need to know about the user. With the default authentication enforcement enabled, the web service can do its own authentication, but only if WebLogic Server authentication first succeeds.
If you explicitly set the enforce-valid-basic-auth-credentials flag to false, WebLogic Server does not perform authentication for HTTP BASIC authentication client requests for which access control was not enabled for the target resource.
In the previous example of a backend web service that authenticates the client, the web service can then perform its own authentication without WebLogic Server having knowledge of the user.
Setting the enforce-valid-basic-auth-credentials Flag
To set the e enforce-valid-basic-auth-credentials flag, perform the following steps:
- Add the
<enforce-valid-basic-auth-credentials>element toconfig.xmlwithin the<security-configuration>element.
:
<enforce-valid-basic-auth-credentials>false</enforce-valid-basic-auth-credentials>
</security-configuration>
本文介绍了解决从Tomcat迁移到WebLogic后出现的OAuth 401错误的方法。通过调整WebLogic Server的安全配置,特别是设置enforce-valid-basic-auth-credentials标志为false,可以允许未受保护资源的请求不经过WebLogic Server的身份验证。
3015

被折叠的 条评论
为什么被折叠?



