您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
7.6 KiB
7.6 KiB
HuaweiService.authservice
Scenario: Authentication service account related认证服务账号相关
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 informationUser信息 |
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<Map>(mapList[i]);
string[] keyArray=temp.keySet().toArray();
for (int j = 0; j < keyArray.Length; j++)
{
//Value can use getOrDefault() function in Map
//for example temp.getOrDefault(keyArray[i], "")
}
}
Scenario: Credential generation of major login methods各大登录方式的credential生成
Description | Api | Reference |
---|---|---|
Obtains a credential using an email address and a password/verification code.邮箱认证credential |
EmailAuthProvider.credentialWithPassword(String email, String password)/EmailAuthProvider.credentialWithVerifyCode(String email, String password, String verifyCode) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/emailauthprovider-0000001054322501 |
Obtains a credential using a mobile number and password/verification code.手机认证credential |
PhoneAuthProvider.credentialWithPassword(String countryCode,String phoneNumber, String password)/PhoneAuthProvider.credentialWithVerifyCode(String countryCode,String phoneNumber, String password, String verifyCode) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/phoneauthprovider-0000001054083788 |
Obtains a credential using a mobile number and password/verification code.第三方账号credential |
FacebookAuthProvider GoogleAuthProvider GoogleGameAuthProvider HWGameAuthProvider.Builder HwIdAuthProvider QQAuthProvider SelfBuildProvider TwitterAuthProvider WeixinAuthProvider WeiboAuthProvider |
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/facebookauthprovider-0000001054202529 (Take Facebook for example, the rest of platforms please refer to the page) |
Scenario: Email mobile phone authentication verification code邮箱手机认证验证码
Description | Api | Reference |
---|---|---|
Applies for a verification code using an email address.邮箱申请验证码 |
EmailAuthProvider.requestVerifyCode(String email, VerifyCodeSettings settings) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/emailauthprovider-0000001054322501 |
Applies for a verification code using a mobile number.手机号码申请验证码 |
PhoneAuthProvider.requestVerifyCode(String countryCode, String phoneNumber, VerifyCodeSettings settings) | https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/phoneauthprovider-0000001054083788 |