core icon indicating copy to clipboard operation
core copied to clipboard

Standardize responses in REST apis when user is not authorized.

Open dsilvam opened this issue 9 years ago • 3 comments

WebResource takes care of portlet validation, but also authorization at API level should transform to 403 (Forbidden) when responding. We sometimes respond with 500, which is not ok.

See the following ones for some examples of this:

dsilvam avatar Nov 14 '17 18:11 dsilvam

Error codes: Code 401 (Unauthorized): When a user has not logged in and attempts to access a restricted REST service Code 403 (Forbidden): When the user has logged in, and attempts to access a restricted REST service that has no permission Code 200 (Ok): When the user has logged in, and attempts to access a restricted REST service that has permission , and everything works fine Code 500 (Internal Server Error): When the user has logged in, and attempts to access a restricted REST service that has permission, but there's an error processing the request

acurionedotcms avatar Feb 05 '18 15:02 acurionedotcms

Passed QA

shaydotcms avatar Feb 05 '18 19:02 shaydotcms

Documented: https://auth.dotcms.com/docs/latest/error-messaging-rest-api

DeanGonzalez avatar Feb 06 '18 14:02 DeanGonzalez