delphi - Is it possible to change the Response Code when user authorization fails in a datasnap server? -
is possible change http response code in datasnap (delphi xe3) server when user authorization fails? it's returning http/1.1 500 internal server error, can happen in many other scenarios, , doesn't describe problem.
along same idea, possible change default response body? currently, it's returning {"error":"user not authorized perform requested action."}, fine, i'd return custom json object if possible.
thanks time!
i ended executing code looked in tdsauthenticationmanager.onuserauthorize
if valid = false begin getinvocationmetadata.responsecode := 403; getinvocationmetadata.responsemessage := jsonresponseobject.tostring; getinvocationmetadata.responsecontent := jsonresponseojbect.tostring; end
Comments
Post a Comment