rlamasb / Firebase.Xamarin

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

BAD request 400 #12

Open tonogueira2 opened 7 years ago

tonogueira2 commented 7 years ago

I'm trying to write with user authentication, as with the rules of the default server. auth! = null ... using the basic method you propose, I have the error BAD 400 ... can you help me?

var item = await firebase .Child("yourentity") .WithAuth(auth.FirebaseToken) .PostAsync(new YourObject());

tonogueira2 commented 7 years ago

?

leosoareslima commented 7 years ago

Happens to me too, all requests return error 400

joanlopez commented 7 years ago

Me too..

Any idea?

jcampana commented 7 years ago

me too! Please any solution please?

joanlopez commented 7 years ago

Finally I've solved it. You have to set false as the second parameter of the method call.

jcampana commented 7 years ago

Any example please?

I read that if we use Firebase V3, we need to create a custom token in a own server. https://firebase.google.com/docs/auth/server#use_a_jwt_library

jcampana commented 7 years ago

@joanlopez Wich method pass you "false"? Any example please?

joanlopez commented 7 years ago

Have a look here: https://github.com/step-up-labs/firebase-authentication-dotnet/issues/4

jcampana commented 7 years ago

@joanlopez I try it but not run :( How to generate the AuthToken? At new Firebase admin web, where is the "".

I need your help! Thanks!

PD: Si ets dius Joan deus ser català com jo també no? :P

vicoruga commented 7 years ago

try using this. var authProvider = new Firebase.Xamarin.Auth.FirebaseAuthProvider(new FirebaseConfig("ApiKey")); var auth = await authProvider.SignInWithEmailAndPasswordAsync("mail", "password");
var firebase = new FirebaseClient("URL");

await firebase .Child("your node") .WithAuth(auth.FirebaseToken) .PostAsync<"YourEntity">(YourentityObject, false);

micdoug commented 7 years ago

Hi. I'm also having this problem in a new Project. I'm trying to authenticate using facebook and google access tokens, but I'm Always receiving a '400 - Bad Request' error. Does anyone know how to solve this problem?

Thanks in advance.

micdoug commented 7 years ago

I have solved the problem. It was a problem with the facebook and google login configurations at the firebase console.

marcogazzola commented 7 years ago

Which configuration?