Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

apex_web_service.make_rest_request, OAuth return ORA-20001: Server responded with unsupported OAuth token type

LemarApr 15 2025

ORA-20001: Server responded with unsupported OAuth token type.
ORA-06512: at "APEX_210200.WWV_FLOW_WEB_SERVICES", line 468
ORA-06512: at "APEX_210200.WWV_FLOW_WEBSERVICES_API", line 713
ORA-06512: at line 7
ORA-06512: at "SYS.DBMS_SQL", line 1766

apex 21.2
ORDS Version 22.3.1.r2901647
Oracle Database 21c Express Edition Release 21.0.0.0.0

SCHEMA 1
created Module Report_xy

GET https://xyz.com:8443/ords/me/xy/x; it is OK without Authentication

Report_view - group, Report_view_user - user

created Role and Privilege
role Report_view
privilege Report_view_priv

then
begin
OAUTH.create_client(
p_name => 'Report_view_user',
p_grant_type => 'client_credentials',
p_owner => 'My company name',
p_description => 'A client for API integrations by the Report_view_user',
p_support_email => 'xxxx@gmail.com',
p_privilege_names => 'Report_view_priv'
);

OAUTH.grant_client_role(
p_client_name => 'Report_view_user',
p_role_name => 'Report_view'
);

commit;

end;

SELECT id, name, auth_flow, response_type, client_id, client_secret
FROM USER_ORDS_CLIENTS;
id xxxxxxxxxxxxxxxxxxxxxxxxx
secret yyyyyyyyyyyyyyyyyyy

SCHEMA 2

plsql-server side

declare
l_clob clob;
begin

apex_web_service.oauth_authenticate(
p_token_url => 'https://xyz.com:8443/ords/me/oauth/token',
p_client_id => 'xxxxxxxxxxxxx',
p_client_secret => 'yyyyyyyyyyyyyyy');

apex_web_service.g_request_headers(1).name := 'Authorization';
apex_web_service.g_request_headers(1).value := 'Bearer ' || apex_web_service.oauth_get_last_token;

l_clob := apex_web_service.make_rest_request (
p_url => 'https://xyz.com:8443/ords/me/xy/x',
p_http_method => 'GET');

end;

Result error:
Ajax call returned server error ORA-20001: Server responded with unsupported OAuth token type. for Execute Server-Side Code.

Rest Data Sources - ORA-20001: Authentication failed.

Can anyone help me find the error?

Thanks
Marc

Comments
Post Details
Added on Apr 15 2025
2 comments
45 views