我是一个新的Spring和Aouth 2,我试图用OAuth2来保护我的春季引导应用程序。但是我的身份验证是nit工作的,它会导致401错误,即使是不安全的url也是如此。我的代码可以在url下面的git集线器中找到。
我使用了下面的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"}另外,当我试图按下面的方式访问我的安全url时,它会产生相同的错误。
curl -i -H "Authorization: Bearer <access_token>" http://localhost:8990/api/secure我已经在网上搜索过了,但还不能解决我的问题。有人能帮帮我吗?
谢谢
Git集线器网址
https://github.com/txmr765/Spring-Oauth2发布于 2017-04-28 09:30:41
身份验证代码几乎没有什么需要修改的地方,而且它现在正在工作。
只需查看curl -vu secureapp:type=password秘密
https://stackoverflow.com/questions/42872316
复制相似问题