Full authentication is required to access this resource解决办法

一、springboot环境下,调试接口,返回如下错误信息:

{
  "timestamp": "2018-03-05 14:43:45",
  "status": 401,
  "error": "Unauthorized",
  "message": "Full authentication is required to access this resource",
  "path": "/apptplatform/login"

}

二、问题可能原因

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-oauth2</artifactId>
</dependency>

oauth2这个包,本身依赖了security的包,请求被这里拦截了。

三、解决方法,如下图配置

security:
  basic:
    enabled: false

可以在配置文件中关闭springboot的安全验证。


版权声明:本文为qq_37054881原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。