Embedded PL/SQL Gateway EPG in DB 12.2 [message #676291] |
Tue, 28 May 2019 05:00  |
John Watson
Messages: 8966 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
I'm having trouble with the EPG in 12cR2. In 12.1 and earlier, little demos like this work:exec dbms_epg.drop_dad('scott_dad')
exec dbms_xdb_config.sethttpport(0)
select dbms_xdb_config.gethttpport from dual;
exec dbms_xdb_config.sethttpport(8008)
exec dbms_epg.create_dad('scott_dad','/scott/*')
create or replace procedure scott.hello_world as begin
htp.print('Hello world at '||to_char(systimestamp));
end;
/
wget http://SCOTT:tiger@127.0.0.1:8008/scott/hello_world
But in 12.2, all I ever get is HTTP request sent, awaiting response... 401 Unauthorized
I've tried doing this:exec dbms_epg.authorize_dad('scott_dad','SCOTT')
exec dbms_epg.set_dad_attribute('scott_dad','database-username','SCOTT')
exec dbms_epg.set_dad_attribute('scott_dad','authentication-mode','Basic') but I cannot make it work.
Any ideas? A security enhancement in 12.2??
Thank you for any insight.
|
|
|
|
Re: Embedded PL/SQL Gateway EPG in DB 12.2 [message #679106 is a reply to message #679098] |
Wed, 05 February 2020 04:11   |
John Watson
Messages: 8966 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Welcome to the forum. Please read the OraFAQ Forum Guide and How to use code tags and make your code easier to read
This works for me in 19.x:exec dbms_epg.create_dad('scott_dad','/scott/*')
select dbms_xdb_config.gethttpport from dual;
exec dbms_xdb_config.sethttpport(8080)
exec dbms_epg.set_dad_attribute('scott_dad','database-username','SCOTT')
exec dbms_epg.authorize_dad('scott_dad','SCOTT')
alter user anonymous account unlock;
create or replace procedure scott.hello_world as begin
htp.print('Hello world at '||to_char(systimestamp));
end;
C:\Users\john>
C:\Users\john>wget http://127.0.0.1:8080/scott/hello_world
--10:10:07-- http://127.0.0.1:8080/scott/hello_world
=> `hello_world'
Connecting to 127.0.0.1:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 51 [text/html]
100%[=================================================================================>] 51 --.--K/s
10:10:07 (2.78 MB/s) - `hello_world' saved [51/51]
C:\Users\john>type hello_world
Hello world at 05-FEB-20 10.10.07.251000000 +00:00
C:\Users\john>
|
|
|
Re: Embedded PL/SQL Gateway EPG in DB 12.2 [message #679194 is a reply to message #679106] |
Fri, 14 February 2020 03:41  |
 |
mhoogen
Messages: 2 Registered: February 2020
|
Junior Member |
|
|
Thanks John.
This might also benefit others:
For us, using database version 19.x was not an option (our software supplier supports database versions 12 and older because of Apex v5.0).
In the end, I migrated to ORDS 18.4 to replace EPG. ORDS >= 18.1/18.3 seem to support database (dynamic) authentication, providing a migration path from EPG.
That worked for us.
|
|
|