ktamas77/firebase-php

generate custom token

Closed this issue · 2 comments

can i make custom token through this library, if yes how ?

Thank you!

@parthjdabhi I am 80% sure you can not make custom tokens through this package. This link
FireBase Create Custom Tokens will help point you in the right direction. FireBase Token Generator for PHP

Personally on my project I ran out of time and had to hack my project, but you can use the javascript SDK on your front end and send back the users token and pass it in to the constructor as the second parameter. Ex:

// Something like this.....
$firebase = new FirebaseLib(env('FIRE_DB_URL'), $request->cookie('accessToken'));

I hope I've helped.