【问题标题】:WSO2 API Manager error code for grant type password invalid授权类型密码无效的 WSO2 API Manager 错误代码
【发布时间】:2017-03-20 22:52:40
【问题描述】:

使用“grant-type=password”请求生成令牌时,虽然凭据无效,但返回的响应为 400。

我希望我的 API Manager 实例返回 401(无效凭据)。我在哪里进行更改。

【问题讨论】:

    标签: wso2 wso2-am


    【解决方案1】:

    您可以像这样修改 Token API 突触文件 (repository/deployment/server/synapse-configs/default/api/_TokenAPI_.xml) 的输出序列。

    <outSequence>
        <filter source="json-eval(error_description)" regex=".*Authentication failed for.*">
            <then>
                <property name="HTTP_SC" value="401" scope="axis2"/>
            </then>
            <else></else>
        </filter>
        <send/>
    </outSequence>
    

    【讨论】:

      猜你喜欢
      • 2023-02-02
      • 1970-01-01
      • 1970-01-01
      • 2015-12-30
      • 2018-08-30
      • 2017-09-16
      • 2015-04-05
      • 2021-10-19
      • 1970-01-01
      相关资源
      最近更新 更多