Change de mendix default 401 Unauthorized response message.

Hi, We use a custom authorization MF (see image) in our API's and there 401 response is generated if not succesfull (see code snippet). I want to edit this message, so that is allignes with our other error messages (we have an errorcode entity and use a export mapping to put it in the httpResponse.Content normally), unfortunately that doesn't work here.  Any ideas? (bump)   { "error": { "code": 401, "message": "You are not authorized to access this resource" } }  
1 answers

In your AUTH_Registrations microflow, you should have an HTTPResponse input parameter. You can edit this HTTPResponse object, to set a custom Content value.



Example + proof. Note that the microflow shown here is the microflow which is configured as the authentication microflow in my REST API.