Spring Boot: Full authentication is required to access this resource

若如初见. 提交于 2019-12-03 23:42:40
A.P

I was getting the same error message for

"curl http://localhost:8080/spring4/beans" :
{"timestamp":1493591079040,"status":401,"error":"Unauthorized","message":"Full authentication is required to access this resource.","path":"/spring4/beans"}

Setting the below property in application.properties bypassed the security check & I could use all the acuator endpoints:

management.security.enabled=false

Many thanx to Angel Gavalda who helped me to solved problem. I used following commands to generate access token and access resource

For Generating Access token:-

curl -k -d 'grant_type=client_credentials&client_id=yourClientId&client_secret=yourClientSecret' https://localhost:9443/oauth2/token

For Accessing Resource:-

curl -k -H "Authorization: Bearer $ACCESS_TOKEN" http://localhost:8080/greeting

McFire

When the answer above does not solve this issue change OAuthConfigurations/RemoveOAuthHeadersFromOutMessage to false in the file api-manager.xml.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!