0

I am developing an Android /IOS app and i want Firebase to manage Authentication and in the same time manage users on my back-end PHP /MySQL (edit some user preferences and such) how could i manage the user authentication state and how to link the user on Firebase to his data on MySQL ?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Youness
  • 1,468
  • 1
  • 9
  • 19
  • 1
    You'll want to pass the ID token from the client-side to your PHP server-side code, and verify it there as shown in https://firebase.google.com/docs/auth/admin/verify-id-tokens. This is the basis for your other operations, for example: if you pass the user preferences along with the ID token, you can store them in the MySQL database (with the UID from the ID token as the key). – Frank van Puffelen Sep 15 '20 at 13:37

1 Answers1

2

You'll want to pass the ID token from the client-side to your PHP server-side code, and verify it there as shown in https://firebase.google.com/docs/auth/admin/verify-id-tokens.

This is the basis for your other operations, for example: if you pass the user preferences along with the ID token, you can store them in the MySQL database (with the UID from the ID token as the key).

Important to realize is that in this scenario the authentication state is managed on the client-side, and not by your PHP code.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807