Verify Token To Login In Firebase (Aauthorization)

I’m coding a website, I us Firebase to store data. I’m currently coding the authorization function and have some questions. My idea of ​​building a decentralized part is like this. When the user logs in, it will send to the API of the server that I host. Then from that API, the token will be sent to the user. Then I use the token to verify. I have some questions as follows:

  1. What do I use to save pre-authorized accounts on Firebase?
  2. Is the process that I authorize the account first, then I log in with that account, then create a token and then I authenticate that token with the command verifyToke(your_token)

I dont really understand how the verifyToken work, how it’s know that token is valid? Is it that I have to save an authorized account somewhere on Firebase so that account’s token will be valid then i can verify?