Skip to content
Menu
Alex Zaballa – Oracle Tips and Guides
  • Home
  • About
Alex Zaballa – Oracle Tips and Guides
January 30, 2025January 31, 2025

ORA-20401: Authorization failed for URI using Auth Token

Hi,

During some tests with object storage and SQL*Loader, I came across an issue.

As usual, I created the credentials in the database:

However, when I attempted to list the files from my bucket, I received the following error:

After checking MOS, I found a relevant note discussing the use of an API Key:

‘ORA-20401: Authorization failed’ error during listing contents of OCI Object storage using PL/SQL in ADB (Doc ID 2680364.1)

I created a credential using the API Key, and it worked successfully.

After some research, I came across this helpful thread discussing the usage of the appropriate OracleIdentityCloudService:

https://community.oracle.com/customerconnect/discussion/748174/troubleshooting-dbms-cloud-access-to-object-storage

Following the instructions, I created credentials using the right Identity Domain for my account:

And everything worked as expected:

I’m using “Oracle-SSO” because this is the “domain” I’m using to log into my account.

For most of the customers, it will be OracleIdentityCloudService/(your OCI login username):

BEGIN
  DBMS_CLOUD.CREATE_CREDENTIAL(
    credential_name => 'MY_CREDENTIAL',
    username => 'OracleIdentityCloudService/(Your OCI login username)',
    password => '(Your auth token)'
  );
END;
/

I hope this helps!

©2025 Alex Zaballa – Oracle Tips and Guides | Powered by WordPress and Superb Themes!