php: "firebase federated identity integration" simple example

114 views
Skip to first unread message

ivo welch

unread,
Jul 9, 2016, 11:46:38 AM7/9/16
to Firebase Google Group

I did manage to get the old identity system to work and posted a short example to http://stackoverflow.com/questions/37900961/easy-google-signin-identification-for-php-backend .  alas, googling for how to do this with firebase and more identity providers is difficult---there are so many outdated pages as there are many versions and php does not seem to be a primary target.  is there a definitive php recommended solution?

I really want just the most simple system to work.  presumably, one php page to put up the login choice to the user (perhaps but not necessarily including sending-an-email as authentication choice) and one php page each to handle error and success.   success means a verified email address.  in the old and google-only page, this meant a gidtoken.

request:
<?php
require_once
('firebase.php');

postloginrequest
('http://success.mywebsite.me','http://success.mywebsite.me', (...));
?>


where ... is presumably a list of choices (google, github, facebook, etc.) with things like appsecrets.


success:


<?php
require_once
('firebase.php');

$goodemail
= decodetoken();
?>



Jacob Wenger

unread,
Jul 10, 2016, 10:34:04 PM7/10/16
to fireba...@googlegroups.com
Hey there,

As you already know, there is not official PHP library for Firebase. As such, there will be no easy way to add authentication for Google, Facebook, etc. and you will have to roll your own solution or use those OAuth providers PHP libraries yourself (if they have them). Once you've authenticated with one of those providers, you can fairly easily hook that system into Firebase Auth using custom tokens. The downside here is that minting custom tokens requires your own server. You can read more about how to do this with the 3.x.x SDK here.

Cheers,
Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/42929af1-1e8e-4cd5-b686-a151bc61a975%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages