1 Reply Latest reply: Oct 21, 2013 8:05 AM by Jstraub-Oracle RSS

    Access a RESTful service that is protected with OAM

    Rgoycoolea-Oracle
      Hi,

      I'm trying to access a restful service that is protected with Oracle Access Management, I'm calling the service with apex_web_service.make_rest_request function, but I get a 302 Found redirect message.

      I Understand that I need to follow the redirect, achieve the authentication by OAM and the I will be redirected to the URI of the service.

      Any advice on how to do the redirect from apex_web_service.make_rest_request function? Do it store the HTTP code status on return somewhere to validate for a 302 for redirect or a 200 for OK?

      Any help is welcome,

      Regards

      Raul
        • 1. Re: Access a RESTful service that is protected with OAM
          Jstraub-Oracle

          Raul,

           

          You can get back the status code of the response by inspecting the global apex_web_service.g_status_code. This global is really only documented in sample code:

           

          APEX_WEB_SERVICE

           

          The basic idea would be you would have to use apex_web_service.make_rest_request to POST the forms based username and password to the URL that you are redirected to. Then you would need to capture the relevant cookies in that response, and then pass those cookies with the next request.

           

          Regards,

           

          Jason