My Oracle Support Banner

Apex_web_service.oauth_authenticate ORA-20001: Authentication Failed. (Doc ID 2925685.1)

Last updated on FEBRUARY 02, 2023

Applies to:

Oracle Application Express (APEX) - Version 21.2 and later
Information in this document applies to any platform.

Symptoms

Below code is not working, it gives: ORA-20001: Authentication failed.

  apex_web_service.oauth_authenticate(
  p_token_url => l_token_url,
  p_wallet_path => 'file:/<path>/wallet',
  p_client_id => '**********',
  p_client_secret => '*******');
 
  apex_web_service.g_request_headers.DELETE();
  -- the oauth_get_last_token takes the token, generated by invoking oauth_authenticate
  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;
 
  apex_web_service.g_request_headers(2).name := 'Content-Type';
  apex_web_service.g_request_headers(2).value := 'application/json';
  -- 3. Call Web Service.
  l_response_clob := apex_web_service.make_rest_request(p_url => l_rest_url, p_http_method => 'POST', p_body => l_body,
  p_wallet_path => 'file:/swpkg/oracle/product/wallet');

Changes

 Trying to use a REST using Oauth2 Authentication with Token

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!


In this Document
Symptoms
Changes
Cause
Solution
References


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