0
IFirebaseConfig config = new FirebaseConfig();
config.Serializer = new ServiceStackJsonSerializer(); //Register ServiceStack.Text
config.Serializer = new JsonNetSerializer();          //Register Json.Net
config.AuthSecret = "authsecret here";
config.BasePath = "https://xyz.firebaseio.com/";
IFirebaseClient client = new FirebaseClient(config);
FirebaseResponse response = client.Get("abc/pqr");
Context.Response.Flush();
Context.Response.Write(response.ToString());

I am getting error in response as 'could not parse auth token', I am using FireSharp library and trying to retrieve data from firebase database

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
vikas dabade
  • 1
  • 1
  • 1

1 Answers1

0

I see you are not defining auth key in firebaseconfig.See github project.

IFirebaseConfig config = new FirebaseConfig
{
     AuthSecret = "your-auth-secret",
     BasePath = "<your-firebase-reference-link>.firebaseio.com/"

};

IFirebaseClient client;

client = new FirebaseClient(config);
         await client.OnAsync("FireSharp/Name/", (sender, args) =>
         {
                //Gets the Unique ID and deletes the any other string attached to it
                string dataFromFB = args.Data;
                string paths = args.Path;
                string key = RemoveNameSubstring(paths);
                string uniqueKey = key.Split('/').Last();
                if (keyHolder.ContainsKey(uniqueKey))
                {
                    keyHolder[uniqueKey] = dataFromFB;
                    AddToListView(dataFromFB);
                }
                else
                {
                    keyHolder.Add(uniqueKey, dataFromFB);
                    AddToListView(dataFromFB);
                }
         });
Navoneel Talukdar
  • 4,393
  • 5
  • 21
  • 42
  • 1
    Able to resolve the above issue by putting the correct auth secret, you can find it in your firebase account => Setting => service account => Database Secret – vikas dabade Apr 20 '18 at 12:37