RedZ
RedZ

Reputation: 1013

Firebase Auth with Laravel

Im trying to develop an app using Flutter which uses OTP to authenticate a user, ive setup Firebase Auth and everything is working fine, the app sends an SMS to the phone number that the user provided, but now im facing a problem with my Laravel based API, how do i login a user after the OTP auth is done ? surely i cant just send a login request tto my API using only his phone number seeing that its very insecure. Im sure im missing something here and i would like some guidance.

Thank you

Upvotes: 0

Views: 1234

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598740

To verify the identity of the user in your backend code, send their ID token from the client to that backend, and verify the ID token there. Once you've verified the user's identity, you can then decide whether they are authorized for the action they are trying to perform.

Upvotes: 1

Related Questions