目录

60180007 What Should I Do If the Server Cannot Obtain the One-tap Sign-in Mobile Number of a HUAWEI ID Through the Authorization Code?

Symptom

Error 60180007 is reported when the server-side API /oauth2/v6/quickLogin/getPhoneNumber is called, indicating that the HUAWEI ID-associated mobile number for one-tap sign-in failed to be obtained.

Possible Causes

  1. When developing the HUAWEI ID one-tap sign-in feature, the LoginWithHuaweiIDButtonParams.loginType property of the sign-in button is not set to LoginType.QUICK_LOGIN.

  2. The authorization code sent by the app to the server was obtained during the prefetch phase of HUAWEI ID one-tap sign-in.

  3. The authorization code sent by the app to the server was not obtained in the HUAWEI ID one-tap sign-in scenario.

Solution

  1. When the anonymous mobile number and privacy agreement are displayed on the one-tap sign-in screen, set the LoginWithHuaweiIDButtonParams.loginType property of the sign-in button to LoginType.QUICK_LOGIN. For complete sample code, see Step 3 Show the screen for one-tap sign-in with a HUAWEI ID and obtain an authorization code. in App-Side Development.

    import { loginComponentManager } from '@kit.AccountKit';
    
    let params: loginComponentManager.LoginWithHuaweiIDButtonParams = {
      // Style supported by LoginWithHuaweiIDButton.
      style: loginComponentManager.Style.BUTTON_RED,
      // Set the sign-in type to one-tap sign-in.
      loginType: loginComponentManager.LoginType.QUICK_LOGIN
    };
    // Use params as the properties of the LoginWithHuaweiIDButton component.
  2. The authorization code obtained during the prefetch phase of one-tap sign-in does not grant authorization to access the user's one-tap sign-in data. Therefore, an error occurs when you call the server API. To obtain the correct authorization code, see Step 3 Show the screen for one-tap sign-in with a HUAWEI ID and obtain an authorization code. and sample code in App-Side Development.

  3. An authorization code is a temporary credential for obtaining user information. The user data that can be obtained varies depending on the scenario in which the authorization code is obtained. Therefore, when integrating HUAWEI ID one-tap sign-in, make sure to follow the procedure described in Signing In with HUAWEI ID Through Just One Tap (Obtaining the Mobile Number, UnionID, and OpenID).