hengboy / spring-cloud-chapter

Spring Cloud Enterprise Core Technology, Corresponding to the Special Subject Source of the Brief Book "Spring Cloud Core Technology"
14 stars 6 forks source link

Swagger2怎么整合OAuth2来在线调试接口? - 程序员 - 恒宇少年 | SpringBoot | SpringCloud | Java - 个人博客 #184

Open hengboy opened 4 years ago

hengboy commented 4 years ago

http://blog.yuqiyu.com/apiboot-swagger-integrated-oauth.html

前言Swagger2作为侵入式文档中比较出色的一员,支持接口认证的在线调试肯定是不在话下的,当我们在调用OAuth2所保护的接口时,需要将有效的AccessToken作为请求Header内Authorization的值时,我们才拥有了访问权限,那么我们在使用Swagger在线调试时该设置AccessToken的值呢?

luckydog1983 commented 4 years ago

我按照实例写,直接运行包这个org.springframework.security.authentication.InsufficientAuthenticationException: There is no client authentication. Try adding an appropriate authentication filter.

luckydog1983 commented 4 years ago

用postman 请求oauth/token时候报401,然后忽略后,上述错误