Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firebase email/password auth with REST API

Is it possible to do email/password auth with the REST API rather the SDKs? (without having to set up my own token server)

I can't find anything in the docs about it.

like image 809
jonydep Avatar asked Oct 19 '25 08:10

jonydep


2 Answers

Nope.

There is no public REST endpoint to authenticate users with email+password (or any other supported provider). When using the REST API, you will have to either mint your own tokens, use your Firebase's secret or get the token from somewhere else (e.g. passed from a client app to your code).

like image 136
Frank van Puffelen Avatar answered Oct 22 '25 03:10

Frank van Puffelen


Yes you can do it! No idea why firebase docs are so retarded for REST. I checked how app generated with this https://github.com/firebase/generator-angularfire . And it uses REST in several cases. Dig deeper. I don't know about all params in this methods, but it works.

To login

GET
<url to your firebase instanse>/auth/password?&email=<email>&password=<password>&v=js-2.2.2&transport=json&suppress_status_codes=true

To sign up

POST
<url to your firebase instanse>/users?&email=<email>&password=<password>&_method=POST&v=js-2.2.2&transport=json&suppress_status_codes=true
like image 33
DmitrySkripkin Avatar answered Oct 22 '25 03:10

DmitrySkripkin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!