How to define custom authentication response of REST services

Hi, all. I use custom authentication to protect the REST APIs. But I see we need to return the User Entity in the end. That’s reasonable, but I want to define the 401 response, something like: { "code":"401", "msg": "some parameter is missing" } rather than the default message: { "error": { "code": 401, "message": "You are not authorized to access this resource" } }  
1 answers

I don't think you can change this message.

HTTP 401 is defined by w3c: 

Afaik it is common practice not to explain anything to the outside world on why the authentication failed, so a possible hacker would not get any feedback on a hacking attempt.

If you really need this, you may want to contact mendix support for this.