Help Center/ Speech Interaction Service/ FAQs/ API/ What Do I Do If the Error Message "auth failed" Is Displayed During SIS API Calling?
Updated on 2022-02-22 GMT+08:00

What Do I Do If the Error Message "auth failed" Is Displayed During SIS API Calling?

Symptom

There are multiple causes for authentication failures. Generally, it is because that an incorrect token is used to access the server.

Solution

  1. Check whether the user account is normal.

    Check whether the user account is recharged or frozen. You can log in to your account and check whether your account balance is sufficient (or query the preceding information on the user console).

  2. Check whether the obtained token is normal.
    • Ensure that the token is obtained within 24 hours.
    • Ensure that the parameter nesting for obtaining the token is correct.

      The following sample code shows the correct nesting. Incorrect nesting can also be used to obtain the token but the token cannot access the service.

  3. Use AK/SK for accessing and check whether the AK and SK are correct.
  4. Check whether the project_id is correctly entered.

    If the fault fails to be located and rectified, contact customer service.

auth_data = {
  "auth": {
    "identity": {
      "password": {
        "user": {
          "name": user_name,                    
          "password": password,                    
          "domain": {
            "name": domain_name                    
          }                
        }            
      },            
      "methods": ["password"]        
    },        
    "scope": {
      "project": {
        "name": region            
      }        
    }    
  }
}