Retrieving header values in PL/SQL HTP packages

1.5k views Asked by At

We have a website running on mod plsql gateway model . The procedure will be invoked from UTL and module PL/SQL executes the HTP procedure to generate the HTML page. Now we are integration this page with siteminder so that we could integrate with corporate credentials and done need to maintain credentials in our oracle DB. The Siteminder is integrated and the siteminder sends the user detail and role group in response header . How to take this response header in HTP procedure?

1

There are 1 answers

0
hekko On

Might be useful the following links

UTL_HTTP package:
https://docs.oracle.com/cd/B28359_01/appdev.111/b28419/u_http.htm#i1013177
short example:

DECLARE
  req   UTL_HTTP.REQ;
  resp  UTL_HTTP.RESP;
  name  VARCHAR2(256);
  value VARCHAR2(1024);
BEGIN
  req := UTL_HTTP.BEGIN_REQUEST('http://example.com');
  UTL_HTTP.SET_HEADER(req, 'User-Agent', 'Mozilla/4.0');
  resp := UTL_HTTP.GET_RESPONSE(req);
  FOR i IN 1..UTL_HTTP.GET_HEADER_COUNT(resp) LOOP
    UTL_HTTP.GET_HEADER(resp, i, name, value);
    DBMS_OUTPUT.PUT_LINE(name || ': ' || value);
  END LOOP;
  UTL_HTTP.END_RESPONSE(resp);
END;

or

OWA_UTIL package:
https://docs.oracle.com/database/121/ARPLS/w_util.htm#ARPLS70773
short exapmle:

OWA_UTIL.get_cgi_env('REMOTE_HOST');