当我们使用身份验证系统时,如何为某些链接添加基本身份验证

问题描述 投票:0回答:1

到目前为止,我们正在使用UAA进行身份验证。但是,对于几个链接(RestController链接),我需要使用用户名和密码添加基本身份验证。我只能添加1。无法同时添加UAA和基本身份验证。任何帮助将不胜感激。

这是带有UAA的webconfig代码

enter image description here

spring-boot rest spring-security basic-authentication cloudfoundry-uaa
1个回答
0
投票

听起来您想要具有多个安全配置,即多次扩展WebSecurityConfigurerAdapter。这样,您可以为不同的路径使用不同的配置(登录方法等,基本身份验证)。

请参见官方文档以获取代码示例:https://docs.spring.io/spring-security/site/docs/current/reference/html5/#multiple-httpsecurity

© www.soinside.com 2019 - 2024. All rights reserved.