WsoWanderer
WsoWanderer

Reputation: 23

WSO2 API Manager error code for grant type password invalid

Upon token generation request using "grant-type=password", while the credentails are invalid, the response returned is 400.

I want my API Manager instance to return 401 (invalid credentials). Where do my make changes.

Upvotes: 2

Views: 373

Answers (1)

Bee
Bee

Reputation: 12513

You can modify the out seqence of Token API synapse file (repository/deployment/server/synapse-configs/default/api/_TokenAPI_.xml) like this.

<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>

Upvotes: 2

Related Questions