You can use either of the following authentication methods when calling APIs:
In AK/SK-based authentication, the AK/SK is used to sign requests and the signature is then added to the requests for authentication.
In AK/SK-based authentication, you can use the AK/SK to sign requests based on the signature algorithm or use a dedicated signing SDK to sign requests. For details about how to sign requests and use the signing SDK, see the AK/SK Signing and Authentication Guide.
The signing SDKs are only used for signing requests and different from the SDKs provided by services.
A token specifies temporary permissions in a computer system. During API authentication using a token, the token is added to request headers to get permissions for calling the API.
When calling the API to obtain a user token, you must set auth.scope in the request body to project.
{
"auth": {
"identity": {
"methods": [
"password"
],
"password": {
"user": {
"name": "user_name",
"password": "********",
"domain": {
"name": "domainname"
}
}
}
},
"scope": {
"project": {
"name": "xxxxxxxx"
}
}
}
}
After a token is obtained, the X-Auth-Token header field must be added to requests to specify the token when calling other APIs. For example, if the token is ABCDEFG..., add X-Auth-Token: ABCDEFG.... to the request header.