Get an Authentication Token

When you send REST API requests to Oracle Cloud Infrastructure Object Storage Classic, you must include an authentication token. You request an authentication token by sending your user credentials to the service. Authentication tokens are temporary; they expire after 30 minutes.

  1. Send a GET request to the authentication endpoint URL.

    Syntax

    curl -i -X GET \
      {authenticationEndpointURL} \
      -H 'x-storage-user: Storage-{accountName}:{userName}' \
      -H 'x-storage-pass: {password}'  
    • You can find out the authentication endpoint URL from the service details page of Oracle Cloud My Services.

    • accountName is the account name.

    • userName and password are the credentials you use to sign in to Oracle Cloud My Services.

    Sample Command

    curl -i -X GET \
      https://myaccount.ocm.rack01.example.com/auth/v1.0 \
      -H 'x-storage-user: Storage-myaccount:myusername' \
      -H 'x-storage-pass: mypassword'
    
  2. In the response, look for the X-Auth-Token header and note its value.

    Sample Response Headers

    HTTP/1.1 200 OK
    Server: nginx/1.10.2
    Date: Wed, 01 Aug 2018 01:05:44 GMT
    Content-Length: 0
    Connection: close
    X-Auth-Token: AUTH_tk10d7cf10041726fa2e64652d975bbab0
    X-Storage-Token: AUTH_tk10d7cf10041726fa2e64652d975bbab0
    X-Storage-Url: https://myaccount.ocm.rack01.example.com/v1/Storage-idcs-63b8bbbbbbb64085920856f814f06720