Authenticate User
/authenticate/
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
- application/oracle-compute-v3+json
object
-
password:
string(password)
The password for the user.
-
user:
string
Two-part name of the user in the format,
/Compute-identity_domain/user
(example:/Compute-acme/joe.jonathan@example.com
)
Response
- application/oracle-compute-v3+json
204 Response
-
set-cookie: string
The cookie value is returned if the session is extended
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.
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