ORDS:错误 401 - 未经 RFC 2068 超文本传输协议授权 - HTTP/1.1:10.4.2 401 未经授权

问题描述 投票:0回答:1

w.r.t。 Oracle REST 数据服务 (ORDS):身份验证
微服务-带有-ords-and-micronaut-part-1的简单方法

使用PLSQL,
通过在 SQL Developer 上尝试以下代码,我收到了

ORA-20001: Authentication failed

BEGIN
    APEX_WEB_SERVICE.OAUTH_AUTHENTICATE(
        P_TOKEN_URL     => 'http://<host:ip>/ords/<schema>/oauth/token',
        P_CLIENT_ID     => 'xxxxxxxxxxBaDNGqSq1atg..',
        P_CLIENT_SECRET => 'xxxxxxxxxx5NlSRSoeJrUw..');
    DBMS_OUTPUT.PUT_LINE(APEX_WEB_SERVICE.OAUTH_GET_LAST_TOKEN);
END;

使用Curl,

curl -i -k --user xxxxxxxxxxBaDNGqSq1atg..:xxxxxxxxxx5NlSRSoeJrUw.. --data "grant_type=client_credentials" http://<host ip:port>/ords/<schema>/oauth/token

我收到了 html 代码,并且以预览格式得到

使用邮递员 我在控制台中得到同样的错误。

curl plsql oauth-2.0 oracle-apex-19.1 oracle-rest-data-services
1个回答
0
投票

对于curl命令,我做了:

curl -X POST -H“内容类型:application/x-www-form-urlencoded”-H“授权:基本$(echo -n'Your_client_id:Your_client_secret' | base64)”-d“grant_type = client_credentials”“ https://SERVER-ip/ords/SCHEMA/oauth/token”

如果您不执行“Authorization: Basic $(echo -n 'Your_client_id:Your_client_secret' | base64)”,则会收到 401 错误。

邮递员没有遇到同样的错误。 你能出示你在邮递员中设置的授权吗?

© www.soinside.com 2019 - 2024. All rights reserved.