You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Issue with Authenticating OCI REST API calls for DNS

Received Response
46
Views
3
Comments
edited Aug 18, 2022 7:42PM in Oracle Cloud Infrastructure - General 3 comments

Summary:

We're using PHP to call the Oracle cloud REST APIs for some DNS configuration. However, the code we are trying to use is only getting back 401 Authentication Errors.

Content (required):

What we know so far:

  1. Direct CLI works. So, the user config information we are trying to reuse in code is correct.
  2. Also tried creating new keypairs and using them in code to sign the request.
  3. System clock is only varying by approx 1 min, so that isn't the problem.

Have ran a debug on the CLI command and below is what it gives:

Request: GET https://dns.us-sanjose-1.oci.oraclecloud.com/20180115/zones/exampledomain.com
Not using Expect header...
send: b'GET /20180115/zones/exampledomain.com HTTP/1.1\r\nuser-agent: Oracle-PythonSDK/2.78.0 (python 3.7.9; AMD64-Windows) Oracle-PythonCLI/3.14.0\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nconnection: keep-alive\r\ncontent-type: application/json\r\nopc-request-id: 670F2*****7304\r\nopc-client-retries: true\r\nopc-client-info: Oracle-PythonSDK/2.78.0\r\ndate: Thu, 18 Aug 2022 17:39:58 GMT\r\nhost: dns.us-sanjose-1.oci.oraclecloud.com\r\nauthorization: Signature algorithm="rsa-sha256",headers="date (request-target) host",keyId="ocid1.tenancy.oc1..<ID>/ocid1.user.oc1..<ID>/<fingerprint>",signature="===masked==",version="1"\r\n\r\n'

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!