Skip to Main Content

Cloud Platform

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.

oci cli - 401 "NotAuthenticated"

3622227Mar 17 2018 — edited Mar 17 2018

Dear Gurus,

This is my first time trying to use oci cli. I completed the install  and config process from the below URL and everything went fine.

https://docs.us-phoenix-1.oraclecloud.com/Content/API/SDKDocs/cliinstall.htm

Created the API keys , uploaded the key to OCI and Configured the profile. Finger prints matches between public.pem (uploaded to OCI) and private key.

Now when i try to issue any command via cli it throws the 401 error irrespective of what I try.

I tried on three different machines with different OS (Windows/Linux ). Looks like I am doing something wrong somewhere. 

Error Message:

[oracle@localhost .oci]$ oci os ns get

ServiceError:

{

    "code": "NotAuthenticated",

    "message": "The required information to complete authentication was not provided.",

    "opc-request-id": "72C5694FDF694AEDA0FA42FBB77E811C",

    "status": 401

}

Clocks seems to be in sync:

curl -s --head https://iaas.us-phoenix-1.oraclecloud.com | grep Date

[oracle@localhost ~]$ curl -s --head https://iaas.us-phoenix-1.oraclecloud.com | grep Date

Date: Sat, 17 Mar 2018 16:25:08 GMT

[oracle@localhost ~]$ date

Sat Mar 17 12:25:16 EDT 2018

setup went fine and have necessary permissions for keys:

[oracle@localhost .oci]$ ls -lrt

total 12

-rw-------. 1 oracle oinstall  451 Mar 17 11:56 oci_api_key_public.pem

-rw-------. 1 oracle oinstall 1679 Mar 17 11:56 oci_api_key.pem

-rw-------. 1 oracle oinstall  302 Mar 17 11:56 config

$cat config

[DEFAULT]

user=ocid1.user.oc1..aaaaxxxxxxxxxrhbpmiv3vmx3fanyfotrjnfa

fingerprint=5e:e3:43:c6:b3:64:73:df:a4:e2:a6:a3:35:e6:39:e3

key_file=/home/.oci/oci_api_key.pem

tenancy=ocid1.tenancy.oc1..aaaaaxjjaryrxflyysgaganbmybm

region=us-"ashburn-1"

I am out of ideas and any help in this regard is greatly appreciated.

This post has been answered by vikram thakur on Mar 17 2018
Jump to Answer

Comments

Artan Hajdari Feb 11 2025

Can someone help me in this case please

1 - 1

Post Details

Added on Mar 17 2018
8 comments
27,780 views