From 5395c421ab81cc99e3b603207756930b03cf4087 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Thu, 10 Oct 2024 11:42:51 +0800 Subject: [PATCH] feat: app-oauth-huawei --- docs/tutorial/app-oauth-huawei.md | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 docs/tutorial/app-oauth-huawei.md diff --git a/docs/tutorial/app-oauth-huawei.md b/docs/tutorial/app-oauth-huawei.md new file mode 100644 index 000000000..c34683d40 --- /dev/null +++ b/docs/tutorial/app-oauth-huawei.md @@ -0,0 +1,70 @@ +# HarmonyOS Next 华为账号登录 @harmonyos-next-huawei-login + +根据华为应用市场上架审核要求,如果应用支持用户使用第三方账号登录,则该应用需提供华为账号登录选项 [文档](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/account-detailedrules-V5) + +## 开发准备 @dev-prepare + +> 调试时可不配置 Scope 权限,上架时需配置 + +- 添加公钥指纹(与你的包名绑定) [如何添加公钥指纹](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/application-dev-overview-V5#section1726913517284) +- 配置 Client ID(配置在 `HBuilder X 项目根目录/harmony-configs/entry/src/main/module.json5` 中) [如何获取 Client ID](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/account-client-id-V5) +- 配置 Scope 权限 [如何申请 Scope 权限](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/account-config-permissions-V5) + +## HBuilder X 配置 @hbuilderx-config + +打开项目的manifest.json文件,在“App模块配置”项的“OAuth(登录鉴权)”下,勾选“华为登录”: + +![](https://web-ext-storage.dcloud.net.cn/doc/app/oauth/manifest-oauto-huawei.jpg) + +### uni-app 中使用示例 @example + +```vue + + + +``` + +## Tips + +- [OpenID和UnionID的长度限制要求](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/account-faq-1-V5) +- [Access Token和Refresh Token的有效时长是多久](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/account-faq-2-V5) +- [Access Token和Refresh Token长度限制要求](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/account-faq-3-V5) +- [调用接口获取应用级Access Token时,是否有次数和频率限制](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/account-faq-4-V5) +- [ID Token的使用场景与使用方法](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/account-faq-7-V5) +- [无法获取手机号或获取到的手机号为空如何解决](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/account-faq-6-V5) +- [未成年人模式开启后USB断连如何解决](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/account-faq-8-V5) -- GitLab