【发布时间】:2017-08-09 21:13:39
【问题描述】:
我是新的 Spring Boot 和 Aouth 2。我尝试使用 OAuth2 保护我的 Spring Boot 应用程序。但是我的身份验证无法正常工作,即使使用不安全的网址也会导致 401 错误。我的代码可以在 git hub 的 url 下找到
我使用了下面的 curl 命令
curl -i http://localhost:8990/api/hello
但结果是
{"timestamp":1489824873836,"status":401,"error":"Unauthorized","message":"Full authentication is required to access this resource","path":"/api/hello"}
此外,当我尝试如下访问我的安全网址时,它会产生相同的错误。
curl -i -H "Authorization: Bearer <access_token>" http://localhost:8990/api/secure
我在互联网上进行了搜索,但仍无法解决我的问题。谁能帮帮我
谢谢
Git 中心网址
https://github.com/txmr765/Spring-Oauth2
【问题讨论】:
-
链接断开,Answer 和 Response 都不完整。
标签: spring-boot spring-security oauth-2.0 spring-oauth2