3 Authentication

All the API calls to Oracle Compute Cloud Service must be authenticated. API calls are authenticated using a token. You can request an authentication token from the Oracle Compute Cloud Service. Then include this token in the subsequent API calls. This section describes how to request the authentication token.

Authenticate User

This API enables you to obtain an authentication token.

This API request returns an authentication token in the Set-Cookie response header. By default, the token expires after 5 minutes. A valid (that is, unexpired) authentication token must be included in every request to the service in the Cookie: request header. The client must check the expiration time and discard the cookie if the cookie has expired. Any requests that include an expired cookie will get an Unauthorized error.

Method

POST

REST Resource

/authenticate/

URI

https://api_endpoint/authenticate/

Request Body Parameters

Parameter Description

user

User name

password

The password for the user

Example URI

https://api.oc.example.com/authenticate/

Example Request Body

{"user": "/mytenant/admin", "password": "mytenant2psswd123" }

Example Response Headers

204 No Content
Used response headers:
x-oracle-compute-call-id: 15102801fb6b260ec3b522beb113021d200f3e
Set-Cookie: nimbula={"identity": "{\"realm\": \"apiexample\", \"value\":
 \"{\\\"customer\\\": \\\"mytenant\\\", \\\"realm\\\": \\\"apiexample\\\",
 \\\"entity_type\\\": \\\"user\\\", \\\"session_expires\\\": 1405250409.271111,
 \\\"expires\\\": 1405241409.271148, \\\"user\\\": \\\"/mytenant/admin\\\",
 \\\"groups\\\": [\\\"/mytenant/admin\\\", \\\"/mytenant\\\"]}\",
 \"signature\": \"AE2vZOGt0XIIEstK0HL6IgJ7vrRxgo30qQrWhwepRbNbATuEMh2k...\"}"};
 Path=/; Max-Age=10800
 expires: Wed, 28 Oct 2015 08:01:04 GMT
 vary: Accept
 server: nginx
 connection: keep-alive
 cache-control: no-cache
 date: Wed, 28 Oct 2015 08:01:04 GMT
 content-type: application/oracle-compute-v3+json