chenxianqi / flutter_mimc

flutter_mimc
https://pub.dev/packages/flutter_mimc
Other
47 stars 11 forks source link

如何使用registerFetchToken 用来使用开发者服务器的安全认证 #2

Closed fulus06 closed 5 years ago

fulus06 commented 5 years ago

如题: https://admin.mimc.chat.xiaomi.net/docs/03-auth.html

fulus06 commented 5 years ago

image

chenxianqi commented 5 years ago

如题: https://admin.mimc.chat.xiaomi.net/docs/03-auth.html

没错,原本有考虑实现这个的,但貌似APP内直接填写部分敏感信息也不是不安全,毕竟打包上线都需要经过混淆来确保APP避免被反编译,这一步实现也比较容易,欢迎PR

chenxianqi commented 5 years ago
/// http response data
/// dart端直接调用后台生成token字符串原样传递过去
String responseToKenString =  {
  "code": 200,
  "message": "success",
  "data": {
      "appId": $appId,
      "appPackage": $appPackage,
      "appAccount": $appAccount,
      "miChid": $chid,
      "miUserId": $uuid,
      "miUserSecurityKey": $appSecret,
      "token": $token,
      "regionBucket": $regionBucket,
      "feDomainName": $feDomainName,
      "relayDomainName": $relayDomainName
  }
}
FlutterMimc flutterMimc = FlutterMimc.stringTokenInit(responseToKenString)
chenxianqi commented 5 years ago

后面会这样实现

chenxianqi commented 5 years ago

此版本已解决该问题,请更新版本以使用v0.1.0