Hello,
I am trying to return custom error description and error. To achieve this, I added below 2 lines in my mapping rule and in JSON response body I get them which is expected however the status code returned is of HTTP 200. Is there any way to override that response status code to something else e.g. 400 in mapping rule?
stsuu.addContextAttribute(new com.tivoli.am.fim.trustserver.sts.uuser.Attribute("error_description", "urn:ibm:names:ITFIM:oauth:response:attribute", "201.2"));
stsuu.addContextAttribute(new com.tivoli.am.fim.trustserver.sts.uuser.Attribute("error", "urn:ibm:names:ITFIM:oauth:response:attribute", "Unauthorized_client"));
Note- I tried using OAuthMappingExtUtils.throwSTSAccessDeniedMessageException("Unauthorized_client"); as well however in this case, the response body I get is and HTTP status code is 401
{
"error_description": "Unauthorized_client",
"error": "access_denied"
}
------------------------------
Niranjan Govardhan
------------------------------