rlamasb / Firebase.Xamarin

Light weight wrapper for Firebase Realtime Database REST API.
MIT License
149 stars 39 forks source link

PostAsync - 401 Unauthorized #25

Open h3r0ld opened 7 years ago

h3r0ld commented 7 years ago

Hey there, I was just testing the API and I experienced that after a successful authentication:

When I set the database rule on firebase to: .write == null It obviously works without using the auth token, but thats a bit risky.. :)

Do you have any idea, why doesn't this work when I'm trying to use Post? :)

Thanks!

tuneis commented 7 years ago

@h3r0ld It gave me that error as well. Not sure why it says unauthorized but if you set the generateOfflineKey parameter to false inside the PostAsync method, that solved it for me.

 var item = await FirebaseClient
                  .Child("someTable")
                  .WithAuth(Auth.FirebaseToken)
                  .PostAsync(someObject, false);

I wonder why the server side generation doesn't work.

h3r0ld commented 7 years ago

Thanks! :)

pallavbohara commented 7 years ago

@h3r0ld Thanks worked for mee too! :)

Ephiljp commented 6 years ago

@h3r0ld Thanks, worked for me ^^