ConnectyCube / connectycube-flutter-sdk-releases

ConnectyCube Flutter SDK Releases
7 stars 1 forks source link

Firebase Phone and Email/Google Sign in not working #99

Closed AbdurrehmanSubhani closed 7 months ago

AbdurrehmanSubhani commented 7 months ago

Platform (use [x]) [] Android [x] iOS [] macOS [] Windows [] Web

Device info Manufacture: Apple Model: iPad Air 3 OS version: 16.5

Describe the bug: signInUsingFirebaseEmail and signInUsingFirebasePhone not return Invalid AppId response when sent with valid project_id and idToken/accessToken

Steps to Reproduce:

  1. Sign in to either Phone/Google Authentication Providers to Firebase
  2. Get user idToken after successfull authentication
  3. call signInUsingFirebaseEmail/signInUsingFirebasePhone with valid projectId and idToken/accessToken

Logs:

flutter: CB-SDK: : =========================================================
flutter: === REQUEST ==== f18c9c32-68bc-4d2c-b353-c8d432cee8b9 ===
flutter: REQUEST
flutter:   POST https://api.connectycube.com/session
flutter: HEADERS
flutter:   {Content-type: application/json, ConnectyCube-REST-API-Version: 0.1.1, CB-SDK: Flutter 2.11.0, CB-Token: }
flutter: BODY
flutter:   {"application_id":"xxxx","auth_key":"xxxxxxxx","nonce":"xxxxxx","timestamp":"1701169177","signature":"xxxxxxxxxxx"}
flutter:
[connection] nw_resolver_start_query_timer_block_invoke [C16.1] Query fired: did not receive all answers in time for www.googleapis.com:443
[connection] nw_resolver_start_query_timer_block_invoke [C17.1] Query fired: did not receive all answers in time for www.googleapis.com:443
flutter: CB-SDK: : *********************************************************
flutter: *** RESPONSE *** 201 *** f18c9c32-68bc-4d2c-b353-c8d432cee8b9 ***
flutter: HEADERS
flutter:   {cb-token-expirationdate: 2023-11-28 12:59:38 UTC, connection: keep-alive, date: Tue, 28 Nov 2023 10:59:38 GMT, strict-transport-security: max-age=15768000; includeSubDomains, content-length: 227, access-control-expose-headers: CB-Token-ExpirationDate, Date, content-type: application/json; charset=utf-8, server: nginx/1.25.0}
flutter: BODY
flutter:   {"session":{"created_at":"2023-11-28T10:59:38.617Z","updated_at":"2023-11-28T10:59:38.617Z","application_id":7406,"token":"xxxxxxxxxx","nonce":1973164698,"ts":1701169177,"user_id":null,"id":649689634}}
flutter:
flutter: ConnectyCubeVoipService | Successfully initialised connectycube voip service
flutter: ConnectyCubeVoipService | Chat connection listener initializing
flutter: CallManagerService | loginToVoipService: logging in with email and password
flutter: ConnectyCubeVoipService | Logging into connectycube using projectId: xxxxx-xxxxxx password: eyJhbGciOiJSUzI1NiIsImtpZCI6IjBiYmQyOTllODU2MmU3MmYyZThkN2YwMTliYTdiZjAxMWFlZjU1Y2EiLCJ0eXAiOiJKV1QifQ.eyJuYW1lIjoiQWJkdXJSZWhtYW4gU3ViaGFuaSIsInBpY3R1cmUiOiJodHRwczovL2xoMy5nb29nbGV1c2VyY29udGVudC5jb20vYS9BQ2c4b2NKMDhhNTJDV0xaYmVJTHg3VzNYa2dQM0RHSW44b0dBN2c0elNrM3dBRVE1UT1zOTYtYyIsImlzcyI6Imh0dHBzOi8vc2VjdXJldG9rZW4uZ29vZ2xlLmNvbS9qdWxpYS1lbGRlcmx5IiwiYXVkIjoianVsaWEtZWxkZXJseSIsImF1dGhfdGltZSI6MTcwMTE2OTE3NiwidXNlcl9pZCI6IjFiNkdMQXBlb1Fkc1NyQmxaS0QzeDJOd3NFMjMiLCJzdWIiOiIxYjZHTEFwZW9RZHNTckJsWktEM3gyTndzRTIzIiwiaWF0IjoxNzAxMTY5MTc2LCJleHAiOjE3MDExNzI3NzYsImVtYWlsIjoiYWFycnN1YmhhbmlAZ21haWwuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZ29vZ2xlLmNvbSI6WyIxMDgwMzk0MzU1NTc2MzQwNTgxMDgiXSwiZW1haWwiOlsiYWFycnN1YmhhbmlAZ21haWwuY29tIl19LCJzaWduX2luX3Byb3ZpZGVyIjoiZ29vZ2xlLmNvbSJ9fQ.Ot-0JL3oOq4TOBFCrB8SJo1RDqvak5Le4aywCjMenprKXNOAWXUk3HwAPWpdxaL1oxKvxI4g0th_740lz2oA0tO4UJPU9QASJAgp0pN_MXFW7EhGH5ci9Kazui1JbcF6KEUFDHZMuI-LP5QWUecS67aeNnE1fUV1pv4edSHYtByFf7MSI1aPICNtVntC3SJdFWV2kfQBibLcB9mG1x30xdunLFZz_7XmtoPsimY1QGkpqX0dhPyWcObKxxM7Yh9Gl12feVaA0DElCSEOc9jyT9NOiunXJDwWFSS3Jyx3pIbGhPjs7kDVO7ERtnf3f8hfl4l0UApiIEnLqqwWoIez8A
flutter: CB-SDK: : =========================================================
flutter: === REQUEST ==== fb26e3ba-3012-436a-ad43-7b845b0a3be2 ===
flutter: REQUEST
flutter:   POST https://api.connectycube.com/login
flutter: HEADERS
flutter:   {Content-type: application/json, ConnectyCube-REST-API-Version: 0.1.1, CB-SDK: Flutter 2.11.0, CB-Token: 9A8EA01A69CCB7690F01F8B1EB495BCC3FFF}
flutter: BODY
flutter:   {"provider":"firebase_email","firebase_email":{"access_token":"eyJhbGciOiJSUzI1NiIsImtpZCI6IjBiYmQyOTllODU2MmU3MmYyZThkN2YwMTliYTdiZjAxMWFlZjU1Y2EiLCJ0eXAiOiJKV1QifQ.eyJuYW1lIjoiQWJkdXJSZWhtYW4gU3ViaGFuaSIsInBpY3R1cmUiOiJodHRwczovL2xoMy5nb29nbGV1c2VyY29udGVudC5jb20vYS9BQ2c4b2NKMDhhNTJDV0xaYmVJTHg3VzNYa2dQM0RHSW44b0dBN2c0elNrM3dBRVE1UT1zOTYtYyIsImlzcyI6Imh0dHBzOi8vc2VjdXJldG9rZW4uZ29vZ2xlLmNvbS9qdWxpYS1lbGRlcmx5IiwiYXVkIjoianVsaWEtZWxkZXJseSIsImF1dGhfdGltZSI6MTcwMTE2OTE3NiwidXNlcl9pZCI6IjFiNkdMQXBlb1Fkc1NyQmxaS0QzeDJOd3NFMjMiLCJzdWIiOiIxYjZHTEFwZW9RZHNTckJsWktEM3gyTndzRTIzIiwiaWF0IjoxNzAxMTY5MTc2LCJleHAiOjE3MDExNzI3NzYsImVtYWlsIjoiYWFycnN1YmhhbmlAZ21haWwuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZ29vZ2xlLmNvbSI6WyIxMDgwMzk0MzU1NTc2MzQwNTgxMDgiXSwiZW1haWwiOlsiYWFycnN1YmhhbmlAZ21haWwuY29tIl19LCJzaWduX2luX3Byb3ZpZGVyIjoiZ29vZ2xlLmNvbSJ9fQ.Ot-0JL3oOq4TOBFCrB8SJo1RDqvak5Le4aywCjMenprKXNOAWXUk3HwAPWpdxaL1oxKvxI4g0th_740lz2oA0tO4UJPU9QASJAgp0pN_MXFW7EhGH5ci9Kazui1JbcF6KEUFDHZMuI-LP5QWUecS67aeNnE1fUV1pv4edSHYtByFf7MSI1aPICNtVntC3SJdFWV2kfQBibLcB9mG1x30xdunLFZz_7XmtoPsimY1QGkpqX0dhPyWcObKxxM7Yh9Gl12feVaA0DElCSEOc9jyT9NOiunXJDwWFSS3Jyx3pIbGhPjs7kDVO7ERtnf3f8hfl4l0UApiIEnLqqwWoIez8A","project_id":"xxxxx-xxxxxx"}}
flutter:
flutter: CB-SDK: : *********************************************************
flutter: *** RESPONSE *** 422 *** fb26e3ba-3012-436a-ad43-7b845b0a3be2 ***
flutter: HEADERS
flutter:   {connection: keep-alive, content-type: application/json; charset=utf-8, date: Tue, 28 Nov 2023 10:59:39 GMT, strict-transport-security: max-age=15768000; includeSubDomains, server: nginx/1.25.0, content-length: 105}
flutter: BODY
flutter:   {"errors":{"base":["Invalid Firebase app name \"xxxx\" provided. App name must be a non-empty string."]}}

Actual result: Not able to login to Connectycube using Firebase Google and Phone Auth Providers. The Connectycube app id gets returned in response to the signIn request .

Expected behavior: Login to Connectycube using both Firebase Google and Phone Auth Providers getting the latest CubeUser data in return

Additional info

TatankaConCube commented 7 months ago

we found the issue on the back-end side, and will notify you later about fixing it

TatankaConCube commented 7 months ago

@AbdurrehmanSubhani could you please check it now? it should work now

AbdurrehmanSubhani commented 7 months ago

Hey! @TatankaConCube,

I have tested signing in with Google and Phone and both are now working as expected. Chat connection login is also working using the session token obtained through cube manager.

Thanks a lot for the quick fix!