【问题标题】:How to extract data from response params in the custom identity provider如何从自定义身份提供者的响应参数中提取数据
【发布时间】:2021-05-07 21:48:34
【问题描述】:

由于 ConnectyCube 服务器的最新维护,我在使用自定义身份提供者进行身份验证时遇到了一个新问题。

我使用 Firebase 作为端点,它返回以下 json 文件(用 Postman 测试):

{
    "kind": "identitytoolkit#GetAccountInfoResponse",
    "users": [
        {
            "localId": "The uid that I want to get",
            "email": "test@test.com",
            "passwordHash": "xxxxxx",
            "emailVerified": false,
            "passwordUpdatedAt": 1607681539305,
            "providerUserInfo": [
                {
                    "providerId": "password",
                    "federatedId": "test@test.com",
                    "email": "test@test.com",
                    "rawId": "test@test.com"
                }
            ],
            "validSince": "1607681539",
            "disabled": false,
            "lastLoginAt": "1620422687374",
            "createdAt": "1607681539305",
            "lastRefreshAt": "2021-05-07T21:24:47.374Z"
        }
    ]
}

以前,为了获取 localId,我使用以下作为响应参数 {"uid": "#{users[0].localId}"} 并且它有效。 现在,当我尝试登录用户时收到错误"base":["Custom Identity Provider uid is required"],而我的代码没有任何变化。

您是否有不使用 [0] 来访问 localID 参数的解决方案,因为这似乎是问题的原因?

我对自定义身份提供者的当前设置:

出现错误的脚本的摘录:

final token = await FirebaseLib().auth.currentUser.getIdToken();
createSession().then((cubeSession) {
   CubeUser user = CubeUser(login: "$token", password: "");
   signIn(user).then((cubeUser) {
        Print("Worked!");
   }).catchError((error) {});
}).catchError((error) {});

【问题讨论】:

  • 这应该可以再次使用请检查

标签: firebase flutter firebase-authentication connectycube


【解决方案1】:

现在应该又可以工作了

请检查

【讨论】:

  • 谢谢,我确认它现在又可以工作了!
猜你喜欢
  • 2018-09-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-02-07
  • 2022-11-30
  • 1970-01-01
  • 2020-08-07
  • 1970-01-01
相关资源
最近更新 更多