1. Overview
This guide explains how to authenticate with the Cloud API in the West 2 region using an Application Credential ID and Secret Key.
After successful authentication, you will receive an authentication token that can be used for subsequent API requests.
2. Required Credentials
Before you begin, ensure you have the following credentials provided by the administrator:
- Application Credential ID (Sample: f963abac76886493#########)
- Project ID (Sample: 831f026XXXXXXXXX83de1ce1e923)
- Application Credential Secret (Sample: my_super_secret_pass)
Note: You can refer to the appropriate article to generate these credentials.
3. Prerequisites
Ensure the following tools are installed on your system:
- curl
- jq
4. Install Required Tools
Install curl
CentOS / RHEL / AlmaLinux / Rocky Linux
sudo yum install curl -yUbuntu / Debian
sudo apt update
sudo apt install curl -yInstall jq
Ubuntu / Debian
sudo apt update
sudo apt install -y jqCentOS / RHEL / AlmaLinux
sudo yum install -y jqVerify the Installation
Verify that both utilities are installed successfully.
jq –version
curl –version5. Verify API Availability
Before authenticating, confirm that the API endpoint is reachable.
Run:
curl -kv https://in-west2.controlcloud.app:5000/If the API is available, the command returns the response headers indicating that the Keystone authentication service is reachable.
6. Authenticate with the API
Send a POST request to obtain an authentication token.
curl -ksD – -o /dev/null \
-H “Content-Type: application/json” \
-d ‘{
“auth”: {
“identity”: {
“methods”: [
“application_credential”
],
“application_credential”: {
“id”: “d638abac76884533#########”,
“secret”: “my_super_secret_pass”
}
}
}
}’ https://in-west2.controlcloud.app:5000/v3/auth/tokens
Replace the sample ID and Secret with the credentials provided to you.
7. Expected Response
If authentication is successful, the API returns:
- HTTP 201 Created
- An authentication token in the response headers.
If authentication fails, the API returns:
- HTTP 401 Unauthorized
8. Troubleshooting
Authentication Failed (401 Unauthorized)
If you receive a 401 Unauthorized response, verify the following:
- Confirm that the Application Credential ID and Secret are correct.
- Verify that you are using the correct authentication URL.
- Check that the API endpoint is reachable by running:
curl -kv https://in-west2.controlcloud.app:5000/- Ensure that the credentials have permission to access the API.
9. View Authenticated Session Details
To retrieve information about the authenticated session, run:
curl -X GET “https://in-west2.controlcloud.app:5000/v3/auth/tokens” \
-H “X-Auth-Token: <AUTH_TOKEN>” \
-H “X-Subject-Token: <AUTH_TOKEN>” \
-H “Content-Type: application/json” | jqReplace <AUTH_TOKEN> with the authentication token returned during the authentication request.
Response Details
The command returns information such as:
- Authenticated user details.
- Assigned roles.
- Accessible projects.
- Available service endpoints.
10. Conclusion
After successful authentication, an authentication token is returned.
Use this token in the X-Auth-Token header when making additional API requests, and store it securely for future use.