https://github.com/codegather/fusion_auth
Flutter阿里云号码认证的融合认证
https://github.com/codegather/fusion_auth
android auth flutter fusion ios objective-c phone sms
Last synced: 4 months ago
JSON representation
Flutter阿里云号码认证的融合认证
- Host: GitHub
- URL: https://github.com/codegather/fusion_auth
- Owner: CodeGather
- License: apache-2.0
- Created: 2023-11-28T05:48:35.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-30T12:16:15.000Z (12 months ago)
- Last Synced: 2025-02-16T10:35:13.638Z (4 months ago)
- Topics: android, auth, flutter, fusion, ios, objective-c, phone, sms
- Language: Objective-C
- Homepage: https://pub-web.flutter-io.cn/packages/fusion_auth
- Size: 55 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/funding.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
[](https://pub.flutter-io.cn/packages/fusion_auth)
[](https://github.com/CodeGather/fusion_auth/blob/master/LICENSE)
[](https://github.com/CodeGather/fusion_auth/issues)
[](https://github.com/CodeGather/fusion_auth/network)
[](https://github.com/CodeGather/fusion_auth/stargazers)
[](https://github.com/CodeGather/fusion_auth)
[](https://github.com/CodeGather/fusion_auth/releases)## 目录
* [插件名称](#插件名称)
* [插件版本](#插件版本)
* [效果图](#效果图)
* [IOS](#IOS)
* [Android](#Android)
* [集成步骤](#集成步骤)
* [最佳实践](#最佳实践)
* [准备工作](#准备工作)
* [插件使用](#插件使用)
* [添加监听](#1-添加监听)
* [初始化SDK配置密钥与UI](#2初始化sdk-initsdk)
* [检查环境](#3一键登录获取token-login)
* [预取号](#4检查认证环境-checkverifyenable)
* [调起授权页面,获取Token](#5一键登录预取号-accelerateloginpage)
* [注意事项](#注意事项)
* [打赏-技术支持](#打赏-技术支持)
* [成长历程](#成长历程)## 插件名称
Fusion_auth是基于阿里云号码认证服务中融合认证SDK的Flutter插件 **请注意如遇问题请先下载源码跑DEMO,如果还是有问题,请提issues**, 本插件集成alibaba
## 插件版本
| platform | support | version |
|:--------:|:-------:|:-----------------------------------------------------------------------------------------:|
| Android | YES | [V1.0.8](https://help.aliyun.com/zh/pnvs/developer-reference/the-android-client-access-3) |
| Ios | YES | [V1.0.8](https://help.aliyun.com/zh/pnvs/developer-reference/the-ios-client-access-3) |## 效果图
### IOS
| 全屏 | 底部弹窗 | 中间弹窗 |
|-------------------------|--------------------|------------------------|
|  |  |  |### Android
| 全屏 | 底部弹窗 | 中间弹窗 |
|-----------------------------|------------------------|----------------------------|
|  |  |  |## 集成步骤
- 1、集成阿里云SDK到客户端中,初始化并调用阿里云SDK。
- 2、对接阿里云API接口 [GetFusionAuthToken](https://help.aliyun.com/zh/pnvs/developer-reference/api-dypnsapi-2017-05-25-getfusionauthtoken) -> 融合认证获取鉴权Token,下发至客户端后传入SDK进行鉴权。
- 3、唤起场景授权页面,部分场景需要用户授权(同意隐私协议、获取短信验证码等)。
- 4、用户授权后,从SDK回调接口获取到换号Token后, 上传到开发者的服务器
- 5、对接阿里云的服务端API接口 [VerifyWithFusionAuthToken](https://help.aliyun.com/document_detail/2384478.html) -> 融合认证获取认证结果,将Token转换为用户的手机号。## 最佳实践
- [最佳实践](https://help.aliyun.com/zh/pnvs/use-cases/best-practices-for-user-authentication)## 准备工作
- 请登录阿里云控制台 [号码认证服务->融合认证](https://dypns.console.aliyun.com/fusionSolution/All)
- 开通融合认证服务
- 创建认证方案 分别添IOS和Android的认证方案,分别获取到方案Code。
- IOS只需要输入绑定`Bundle name`即可,
- Android则需要包名和和签名。[如何获取App的签名](https://help.aliyun.com/document_detail/87870.html)
- 添加短信模版、签名 (** 注意如果认证策略没有添加短信可以不添加 **)
- [添加短信签名](https://dysms.console.aliyun.com/domestic/text/sign/add)
- [添加短信模版](https://dysms.console.aliyun.com/domestic/text/template/add)## 插件使用
## 注意事项
- 关于授权页面唤起成功后点击事件穿透问题,本插件提供的方案是在唤起页面后通过添加蒙层已实现点击事件的隔离,具体实现请参考DEMO, 格式如下:
``` dart
Stack(
children: [
..........
isCurrentLogin ? Positioned(
top: 0,
right: 0,
bottom: 0,
left: 0,
child: Container( color: Colors.transparent ),
) : Container(),
]
)
```## 打赏-技术支持
| Wechat | Alipay |
|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
|  |  |## 知识星球
### 为了不浪费大家宝贵的时间,也迫于现实的压力,如果你想获取更优质的服务欢迎加入知识星球,提供的服务远比一杯咖啡更有性价比
![]()
## 成长历程
[](https://starchart.cc/CodeGather/fusion_auth)