springboot引入security,测试接口报Unauthorized

1、报错截图

2、当前项目pom文件引入security

复制代码
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-security</artifactId>
    <version>2.2.2.RELEASE</version>
</dependency>

3、解决办法

复制代码
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class,
        ManagementWebSecurityAutoConfiguration.class})
相关推荐
计算机魔术师16 小时前
传统基础架构 - 微服务
大数据·后端·微服务·架构·开发工具·编程语言
Geek-Chow20 小时前
在 EKS Fargate 上做微服务蓝绿发布:把切换点放在 ALB 上
微服务·云原生·架构·devops·蓝绿部署
豆瓣鸡1 天前
Spring Cloud Gateway 核心原理:从请求转发到微服务流量治理
网关·spring cloud·微服务
confiself2 天前
树形思考研究进展
java·大数据·微服务
敲代码的嘎仔2 天前
从零搭建微服务:Spring Cloud Alibaba 全家桶踩坑实录(Nacos + OpenFeign + Gateway + Sentinel)
java·spring boot·spring·spring cloud·微服务·gateway·sentinel
纯真时光3 天前
微服务保护
微服务
纯真时光3 天前
微服务分布式事务 -- XA,AT,TCC模式
分布式·微服务
豆瓣鸡3 天前
Sa-Token 核心原理与实战:从登录会话到微服务权限鉴权
网关·微服务·架构·认证鉴权
Wang's Blog3 天前
Go-Zero 项目开发47:自研微服务框架的必要性与核心结构设计
开发语言·微服务·golang
小罗水4 天前
附录A 各微服务完整 application.yml 配置汇总
数据库·elasticsearch·微服务