security - Spring 启动: Full authentication is required to access this resource

标签 security spring-boot access-token wso2-identity-server

我正在使用这篇文章中的 wso2is 服务器进行 Spring Boot Security 示例 https://github.com/angel-git/wso2is-springoauth ,当我尝试使用访问 token 访问资源时,我得到

{"error":"unauthorized","error_description":"Full authentication is required to access this resource"}

我通过以下方式生成访问 token :

curl -u CLIENT_ID:CLIENT_SECRET-k -d "grant_type=password&username=admin&password=admin" -H "Content-Type:application/x-www-form-urlencoded" https://localhost:9443/oauth2/token

并通过以下方式访问资源:

curl -H GET "Authorization: ACCESS_TOKEN" http://localhost:8080/greeting

我在 stackoverflow 上找到了很多解决方案,但不幸的是无法解决我的问题

请帮忙,谢谢

最佳答案

我收到了相同的错误消息

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

application.properties 中设置以下属性绕过了安全检查,我可以使用所有 acuator 端点:

management.security.enabled=false

关于security - Spring 启动: Full authentication is required to access this resource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37612648/

相关文章:

security - Vagrant 默认不安全?

c# - 使用 Auth0 授权来 self 们的 SPA 和其他后端服务的 API 请求

session - Web 应用程序的基于 token 的身份验证 : how to cache token?

hibernate - 如何在 Spring Boot 上使用 Hibernate 生成自动 UUID

ios - 将其他变量添加到钥匙串(keychain)中

php - 保护 PHP 源文件免受 file_get_contents() 的影响?

java - bouncycaSTLe + JBoss AS7 : JCE cannot authenticate the provider BC

algorithm - 确定性哈希函数可以轻松解密吗?

java - 如何使用 Spring Security 允许来自某个 url 的请求

java - 使用 Wss4jSecurityInterceptor 抛出 WRONG_DOCUMENT_ERR : A node is used in a different document than the one that created it