【问题标题】:spring oauth2 server returning html responsespring oauth2 服务器返回 html 响应
【发布时间】:2017-07-25 05:18:34
【问题描述】:

https://localhost:8443/Service/oauth/token?grant_type=client_credentials 我在授权标头中传递客户端凭据。 情况 1:当客户端凭据正确时 Json 响应应该是正确的。 案例 2:当客户端凭据在正确的 html 响应中时,为什么? 如果在数据库中找不到客户端,我将在 loadclientbyId() 中抛出新的 ClientRegistrationException(client)。 任何可能有问题的建议。谢谢。

html 回复:html response

【问题讨论】:

    标签: spring-security-oauth2


    【解决方案1】:

    不要使用您的浏览器来测试您的端点。 使用 http 客户端(我使用 Postman https://www.getpostman.com/ 但还有其他的)

    【讨论】:

    • 我找到了根本问题。客户端通过基本身份验证过滤器进行身份验证。如果身份验证失败,则没有错误处理。link
    猜你喜欢
    • 1970-01-01
    • 2017-05-25
    • 1970-01-01
    • 1970-01-01
    • 2013-08-23
    • 2020-07-11
    • 1970-01-01
    • 1970-01-01
    • 2014-11-18
    相关资源
    最近更新 更多