Why Am I Seeing the Error Message "Incorrect IAM authentication information" When I Call an API?
You may encounter the following errors related to IAM authentication information:
- Incorrect IAM authentication information: AK access failed to reach the limit,forbidden
- Incorrect IAM authentication information: decrypt token fail
- Incorrect IAM authentication information: Get secretKey failed
Incorrect IAM authentication information: AK access failed to reach the limit,forbidden
{"error_msg": "Incorrect IAM authentication information: AK access failed to reach the limit,forbidden." ......"error_code": "APIG.0301","request_id": "******"}
Possible Causes
- The AK and SK do not match. Check whether the SK is correct.
- AK/SK authentication fails for more than five consecutive times, and the AK/SK pair is locked for five minutes. (Authentication requests are rejected within this period). Try again 5 minutes later.
- An expired token is used for token authentication. Obtain a new token.
Solution
- Check whether the SK is correct.
- Try again 5 minutes later.
- Obtain a new token.
Incorrect IAM authentication information: decrypt token fail
{"error_msg": "Incorrect IAM authentication information: decrypt token fail","error_code": "APIG.0301","request_id": "******"}
Possible Cause
The token cannot be parsed for IAM authentication of the API.
Solution
- Check whether the obtained token is the token of the corresponding IAM account.
- Check whether the token is correct.
- Check whether the token has been obtained in the environment where the API is called.
Incorrect IAM authentication information: Get secretKey failed
{"error_msg": "Incorrect IAM authentication information: Get secretKey failed,ak:******,err:ak not exist","error_code": "APIG.0301","request_id": "******"}
Possible Cause
The AK used for IAM authentication of the API does not exist.
Solution
Check whether the AK is correct.
Parent topic: Calling APIs
- Incorrect IAM authentication information: AK access failed to reach the limit,forbidden
- Incorrect IAM authentication information: decrypt token fail
- Incorrect IAM authentication information: Get secretKey failed