【发布时间】:2016-02-29 00:38:47
【问题描述】:
我已经创建了 Spring MVC 应用程序并设置了 Spring Security OAuth 2。 从我的浏览器调用方法时,我得到了 XML:
<oauth>
<error_description>
Full authentication is required to access this resource
</error_description>
<error>unauthorized</error>
</oauth>
浏览器发送以下标头:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
当我设置 json 接受标头时,我得到 JSON。我需要强制我的授权服务器始终发送 JSON。没有找到任何解决方案。谢谢。
【问题讨论】:
标签: java spring spring-mvc spring-security spring-security-oauth2