Authenticate User

post

/authenticate/

Note: This request returns an authentication token in the Set-Cookie response header. The token expires after 30 minutes. A valid (that is, unexpired) authentication token must be included in every request to the service, in the Cookie: request header. The client making the API call must examine the cookie expiry time and discard it if the cookie has expired. Requests sent with expired cookies will result in an Unauthorized error in the response.

Request

Supported Media Types
Body ()
The request body contains details of authenticate user request
Root Schema : Authenticate
Type: object
The request body contains details of authenticate user request
Show Source

Response

Supported Media Types

204 Response

No Content. See Status Codes for information about other possible HTTP status codes.
Headers

Examples

cURL Command

The following example shows how to get an authentication cookie from Compute Classic by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL.

Enter the command on a single line. Line breaks are used in this example for readability.

curl -i -X POST
     -H "Content-Type: application/oracle-compute-v3+json"
     -d "@requestbody.json"
        https://api-z999.compute.us0.oraclecloud.com/authenticate/
  • api-z999.compute.us0.oraclecloud.com is an example REST endpoint URL. Change this value to the REST endpoint URL of your Compute Classic site. For information about finding out REST endpoint URL for your site, see Send Requests.

Example of Request Body

The account creation email from Oracle contains the user name and password for your Compute Classic instance.

If you don't have this information, contact your service administrator.

While making REST API calls, you have to pass a two-part user name in a predefined format. See Authentication.

Note:

All examples in this document use /Compute-acme/jack.jones@example.com as the two-part user name. If you are using a Cloud Account with IDCS, replace acme in the two-part user name with your service instance ID.

The following shows an example of the request body content in the requestbody.json file.

{
 "password": "acme2passwrd123",
 "user": "/Compute-acme/jack.jones@example.com"
}

Example of Response Header

The following example shows the response body in JSON format.

Some lines may be truncated with ellipses (...) for readability.

HTTP/1.1 204 No Content
Date: Tue, 12 Apr 2016 15:34:52 GMT
Server: nginx
Content-Type: text/plain; charset=UTF-8
X-Oracle-Compute-Call-Id: 16041248df2d44217683a6a67f76a517a59df3
Expires: Tue, 12 Apr 2016 15:34:52 GMT
Cache-Control: no-cache
Vary: Accept
Content-Length: 0
Set-Cookie: nimbula=eyJpZGVudGl0eSI6ICJ7XC...fSJ9; Path=/; Max-Age=1800
Content-Language: en