Firebase Authentication "Incorrect Password"

So could I just add a few blocks of code that somehow state that if the account credentials are correct then to open the home screen, and if incorrect to show a message?


Tried lots of different equations and actions, variables, nothing seems to be working correctly.

You need to test the first response from SignIn. If idToken does not exist, then "incorrect email or password" message to user. This will work when using the signin url. The signup url will allow any email/password.

Something like this:

So I'm guessing you'd add the open another screen block under the call Web1 post text block, am I correct?

Or probably under the area where else if get global action = getAccountInfo
And on the next then, I'll add the blocks I would want

I feel like ever since i've used this set of code, my thing just stopped working? It keeps telling me invalid id token and I'm not sure why?

Hello there,

It seems as if something is wrong with the Create Account screen on my app, because It doesn't seem to be saving my idToken to the get global token command, so when I need to use TinyDB to get the token and use it on the sign in screen it doesn't work. I tracked down the problem and I'm pretty sure the problem is somewhere on this screen. I've tried lots of methods and changed around some blocks but I'm not sure what's causing the problem.
I've provided my blocks on the CreateAccount screen, but if needed I can provide all of the blocks on my SignIn Screen

You need to ensure that where ever you sign in you get the idToken, because a new idToken is generated each time you sign in. As previously advised, the saving of the idToken to tinydb is not required because you will get a new idToken every time you sign in.

Are you expecting the user to verify their email before they can sign in to use the app? If so, you do not appear to show the blocks for this.

Your getAccountInfo url still looks incorrect, you only need the idToken, you do not need to sign in. (and sign in only requires the email and password)

I use TinyDB to store the idToken and to get it on the Sign In screen since they aren't on the same screen, but I don't know why I'm not getting the idToken.

Yes, Hopefully the user is able to verify their email before they sign in, I deleted the blocks for that but never re added it back. I think I was using if StatusText.Text contains true, then "successfully log in" else "Please verify your email"

I know the sign in only requires email and pass, on the create account screen I just added another box for their name. And I don't have a variable for getAccountInfo nor can I find it in my script or on the Rest API website.

I meant "createaccount"

The link I have in my createAccount variable is:

https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=

I keep repeating myself, every time you sign up or sign in your get a new idToken. Sign Up sets the user, sign in confirms the user is signed up.

Please refer to

to understand when to use the idToken

Alright, so what would I do if I want the user to have a verified email to sign in? And I know that if I close the app and try to log in again, It won't work.

See here in order to sign up, verify and sign in

Alright, I'll do that. Does it mention how to save the token so you are able to log in after you close the app?

See previous repeated answers about this....

I don't really see anything about saving the tokens but correct me if I'm wrong, it's just the only problem I currently have and it's also annoying when I try to test my app and I have to create a new account every time

Because I do not use any other real screens in my work. Use virtual screens then you do not have to worry about "saving" variables to tinydb

Just delete the created account in the firebase console (authentication), then you can use the same details...

Sorry, I meant for a user. When a user closes the app and reopens it again they will not be able to log in and obviously can't just delete their account and make another one through firebase. I didn't mean for me to create and delete accounts in firebase for testing reasons

Hello All :grin:

After what you have guys showed me I was able to create accounts in MIT App Inventor but I want to do something extra. Can I be able to making it so that I can save additional information for a specific user and display it on a different screen? Let us say we have one screen and I store the information typed in with Firebase and I call it on another screen, but I just want it to save for that specific user and maybe also store other data for only that specific user.