【问题标题】:apex_web_service.make_rest_request required ACL privilegesapex_web_service.make_rest_request 所需的 ACL 权限
【发布时间】:2020-05-19 06:21:15
【问题描述】:

我正在关注this tutorial 从 PL/SQL 访问安全的 Web 服务。以下代码有效(作为用户 SYSTEM):

select utl_http.request(
    'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson',
    wallet_path => 'file:c:\oracle\wallet\https_wallet',
    wallet_password => '******'
) from dual;

但是,我需要使用apex_web_service.make_rest_request API 来代替utl_http.request 来获得它的附加功能:

select apex_web_service.make_rest_request(
    p_url => 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson', 
    p_http_method => 'GET',
    p_wallet_path => 'file:c:\oracle\wallet\https_wallet') from dual;

这会返回:

ORA-24247: network access denied by access control list (ACL)

我配置的 ACL:

select privilege, host, lower_port, upper_port
from dba_network_acl_privileges p
join dba_network_acls a on a.aclid = p.aclid
where principal = 'SYSTEM';

PRIVILEGE                HOST  LOWER_PORT UPPER_PORT
------------------------ ----- ---------- ----------
resolve                  *                          
connect                  *                          
use-client-certificates  *                          
use-passwords            *                          
http                     *                          

除了utl_http.request 之外,apex_web_service.make_rest_request 还需要哪些额外的 ACL 或特权?

使用 Oracle XE 18c / Windows 10

【问题讨论】:

  • 检查这个link关于ORA-24247
  • 另外,一般情况下,您不应使用 SYSTEM 帐户或任何其他 Oracle 默认帐户来执行应用程序代码。这是一个特权过度的帐户,应始终锁定。使用仅具有应用程序运行所需的最低权限的自定义帐户。
  • @Kumar link 的问题在于端口限制。如上所示,我没有端口限制。因此,我感谢您提供帮助的尝试,但我不知道您为什么将两者联系起来。
  • @pmdba 是的,通常我也不应该授予所有主机的所有权限。但这些都是在处理神秘的权限错误消息时的调试策略。

标签: oracle web-services oracle-apex acl privileges


【解决方案1】:

您需要为具有连接权限的 APEX 架构创建一个 ACL,并为 APEX 架构创建一个 ACL,以便在您使用 HTTPS 时访问您的钱包

【讨论】:

  • 我的实例上没有名为“APEX”的架构。你能澄清一下吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-01-28
  • 1970-01-01
  • 2012-10-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-09-17
相关资源
最近更新 更多