How to extract data from response params in the custom identity provider

172 views Asked by At

Since the latest maintenances from ConnectyCube servers, I am experiencing a new issue when I authenticate with the custom identity provider.

I use Firebase as endpoint and it return the following json file (tested with Postman) :

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

Previously, to get the localId, I used the following as responses params {"uid": "#{users[0].localId}"} and it worked. Now I get the error "base":["Custom Identity Provider uid is required"] when I try to sign in the users while nothing changed in my code.

Do you have a solution to access to the localID parameter without using [0] as it seems to be the cause of the issue?

My current settings for the custom identity provider:

Extract of my script where the error appear:

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) {});
1

There are 1 answers

1
Rubycon On BEST ANSWER

This should work now again

Please check