WAResponseGenerator>>#forbidden

Norbert Schlemmer <[email protected]> Fri, 15 Dec 2023 11:18:04 +0100 (CET)
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <[email protected]>
--===============8626787858370822836==
Content-Type: multipart/alternative;
	boundary="----=_Part_9412409_273856270.1702635484093"

------=_Part_9412409_273856270.1702635484093
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hello
 
using Seaside 3.4.5 as part of VAST Platform 2023 running on Windows Server.
 
Have added a REST API to our Smalltalk application and have an issue e.g. in case of basic auth leads to #forbidden. In this case the response is generated by
WAResponseGenerator>>#forbidden as plain text.
Would expect that a json response will be returned.
Does anybody have a sub class of WAResponseGenerator like WAHtmlResponseGenerator for mime type JSON / "WAMimeType applicationJson" ?
 
thanks
Norbert
 
Example
 
     curl.exe -X POST https://10.22.2.10/rest/activateMission --insecure ^
     -H "accept: application/json" ^
     -H "content-type: application/json" ^
     -H "authorization: Basic xxx...xxx" ^
     --data "{\"MissionNumber\":1,\"MissionName\":\"Mission one\"}"
 
     Error: you are forbidden to access "/rest/activateMission"
 
------=_Part_9412409_273856270.1702635484093
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

<!doctype html>
<html>
 <head> 
  <meta charset="UTF-8"> 
 </head>
 <body>
  <div class="default-style">
   Hello
  </div> 
  <div class="default-style">
   &nbsp;
  </div> 
  <div class="default-style">
   using Seaside 3.4.5 as part of VAST Platform 2023 running on Windows Server.
  </div> 
  <div class="default-style">
   &nbsp;
  </div> 
  <div class="default-style">
   Have added a REST API to our Smalltalk application and have an issue e.g. in case of basic auth leads to #forbidden. In this case the response is generated by
  </div> 
  <div class="default-style">
   WAResponseGenerator&gt;&gt;#forbidden as plain text.
  </div> 
  <div class="default-style">
   Would expect that a json response will be returned.
  </div> 
  <div class="default-style">
   Does anybody have a sub class of WAResponseGenerator like WAHtmlResponseGenerator for mime type JSON / "WAMimeType applicationJson" ?
  </div> 
  <div class="default-style">
   &nbsp;
  </div> 
  <div class="default-style">
   thanks
  </div> 
  <div class="default-style">
   Norbert
  </div> 
  <div class="default-style">
   &nbsp;
  </div> 
  <div class="default-style">
   Example
  </div> 
  <div class="default-style">
   &nbsp;
  </div> 
  <div class="default-style" style="padding-left: 40px;">
   <span style="font-family: courier new, courier;">curl.exe -X POST https://10.22.2.10/rest/activateMission --insecure ^</span>
   <br><span style="font-family: courier new, courier;">-H "accept: application/json" ^</span>
   <br><span style="font-family: courier new, courier;">-H "content-type: application/json" ^</span>
   <br><span style="font-family: courier new, courier;">-H "authorization: Basic xxx...xxx" ^</span>
   <br><span style="font-family: courier new, courier;">--data "{\"MissionNumber\":1,\"MissionName\":\"Mission one\"}"</span>
  </div> 
  <div class="default-style">
   &nbsp;
  </div> 
  <div class="default-style"> 
   <div style="padding-left: 40px;">
    <span style="font-family: courier new, courier; color: #ff0000;">Error: you are forbidden to access "/rest/activateMission"</span>
   </div> 
   <div>
    &nbsp;
   </div> 
  </div>
 </body>
</html>
------=_Part_9412409_273856270.1702635484093--

--===============8626787858370822836==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
seaside mailing list -- [email protected]
To unsubscribe send an email to [email protected]

--===============8626787858370822836==--