My Oracle Support Banner

ORDS Basic Authentication Not Working (Doc ID 2375337.1)

Last updated on AUGUST 04, 2018

Applies to:

Oracle REST Data Services - Version 3.0.12 and later
Oracle Application Express (APEX) - Version 5.1 and later
Information in this document applies to any platform.

Symptoms

ORDS basic authentication is not working:

Reproducing Testcase:
==========================
Logged into SCOTT user and enabled ORDS for it through SQL Developer:
and then followed the below steps:
BEGIN
ORDS.enable_schema(
p_enabled => TRUE,
p_schema => 'SCOTT',
p_url_mapping_type => 'BASE_PATH',
p_url_mapping_pattern => 'jpnris',
p_auto_rest_auth => FALSE
);
COMMIT;
END;

BEGIN
ORDS.ENABLE_OBJECT(p_enabled => TRUE,
p_schema => 'SCOTT',
p_object => 'EMP',
p_object_type => 'TABLE',
p_object_alias => 'emp',
p_auto_rest_auth => FALSE);
commit;
END;

BEGIN
ORDS.create_role (
p_role_name => 'ords_jpn_role'
);
COMMIT;
END;

SELECT * FROM user_ords_roles

--->
10046 oracle.dbtools.role.autorest.SCOTT SCOTT 31-JAN-18 SCOTT 31-JAN-18 10
1 OAuth2 Client Developer SYS 15-JUL-17 SYS 15-JUL-17 10
2 SQL Developer SYS 15-JUL-17 SYS 15-JUL-17 10
3 RESTful Services SYS 15-JUL-17 SYS 15-JUL-17 10
4 Schema Administrator SYS 15-JUL-17 SYS 15-JUL-17 10
5 oracle.dbtools.autorest.any.schema SYS 15-JUL-17 SYS 15-JUL-17 10
6 SODA Developer SYS 15-JUL-17 SYS 15-JUL-17 10
10104 ords_jpn_role SCOTT 28-FEB-18 SCOTT 28-FEB-18 10041

DECLARE
l_arr OWA.vc_arr;
BEGIN
l_arr(1) := 'ords_jpn_role';
ORDS.define_privilege (
p_privilege_name => 'ords_jpn_priv',
p_roles => l_arr,
p_label => 'jpnris Data',
p_description => 'Allow access to the jpnris data.'
);
COMMIT;
END;
/
Validate - SELECT id, name FROM user_ords_privileges

----->
10047 oracle.dbtools.autorest.privilege.SCOTT
1 oracle.dbtools.sqldev
10105 ords_jpn_priv

To view the relationship between privilege and role:

(3)
BEGIN
ORDS.create_privilege_mapping(
p_privilege_name => 'ords_jpn_priv',
p_pattern => '/jpnris/*'
);
COMMIT;
END;
/

(4)
BEGIN
ORDS.create_privilege_mapping(
p_privilege_name => 'ords_jpn_priv',
p_pattern => '/batch/*'
);
COMMIT;
END;
/

Moving with the Basic Authentication:

java -jar ords.war user ords_jpn_user ords_jpn_role
Enter a password for user ords_user: Welcome1
Confirm password for user ords_user: Welcome1
---->
D:\ords.3.0.11>java -jar ords.war user ords_jpn_user ords_jpn_role
Enter a password for user ords_jpn_user:
Confirm password for user ords_jpn_user:
Feb 28, 2018 2:39:22 PM oracle.dbtools.standalone.ModifyUser execute
INFO: Created user: ords_jpn_user in file:
D:\ords.3.0.11\location\ords\credentials

D:\ords.3.0.11>

Without testing CURL , i have tested directly with browser :
http://localhost:8082/ords/jpnris/emp/

This provides me output as below without prompting for username and password
for authentication (this is the issue):

{
items: [
{
empno: 7839,
ename: "KING",
job: "PRESIDENT",
mgr: null,
hiredate: "1981-11-16T18:30:00Z",
sal: 5000,
comm: null,
deptno: 10,
links: [
{
rel: "self",
href: "http://localhost:8082/ords/jpnris/emp/7839"
}
]
},

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.