Api | Reference |
---|---|---
Signs in a user to AppGallery Connect through third-party authentication.
``登录``|AGConnectAuth.signIn(AGConnectAuthCredential credential)|[https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530)
Signs in a user anonymously.
``匿名登录``|AGConnectAuth.signInAnonymously()|[https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530)
Creates an account using an email address.
``邮箱认证注册``|AGConnectAuth.createUser(EmailUser emailUser)|[https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530)
Creates a user using a mobile number.
``手机号码认证注册``|AGConnectAuth.createUser(PhoneUser phoneUser)|[https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530)
Resets a user's password using the email address.
``邮箱重置密码``|AGConnectAuth.resetPassword(String email, String newPassword, String verifyCode)|[https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530)
Resets a user's password using the mobile number.
``手机号码重置密码``|AGConnectAuth.resetPassword(String countryCode, String phoneNumber, String newPassword, String verifyCode);|[https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530)
Signs out a user and deletes the user's cached data.
``登出``|AGConnectAuth.signOut()|[https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530)
Deletes the current user information and cache information from the AppGallery Connect server.
``删除用户``|AGConnectAuth.deleteUser()|[https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530)
#### Scenario: Link account``关联账号``
|
Description |
Api | Reference |
---|---|---
Links a new authentication mode for the current user.
``关联``|AGConnectUser.link(AGConnectAuthCredential credential)|https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectuser-0000001054522513
Unlinks the current user from the linked authentication mode.
``取消关联``|AGConnectUser.unlink(int provider)|https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectuser-0000001054522513
#### Scenario: Obtain authentication service user information``获取认证服务用户信息``
|
Description |
Api |
Reference |
---|---|---
Obtains information about the current signed-in user. If the user has not signed in, a null value is returned.
``获取User信息集合``|AGConnectAuth.getCurrentUser()|https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/agconnectauth-0000001054482530
User information
``User信息``|AGCConnectUser,Please refer to:https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agconnectuser-0000001054522513|https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agconnectuser-0000001054522513
`getProviderInfo()`,refer How to use getProviderInfo() below!
How to use ``getProviderInfo()``
For example:
```
List temp=agConnectUser.getProviderInfo();
AndroidJavaObject[] mapList=temp.toArray();
for (int i = 0; i < mapList.Length; i++)
{
Map temp=HmsUtil.GetHmsBase