ktamas77 / firebase-php

Firebase PHP Client
792 stars 215 forks source link

How can I get the user authentication data? #39

Open francesco98 opened 8 years ago

francesco98 commented 8 years ago

I can easily read or write data, but what about user authentication data?

alexsup commented 8 years ago

Can you expand on what you mean by user authentication data?

This client is for basic Firebase interactions. There are a number of pull requests to improve this but this repo isn't maintained.

ktamas77 commented 8 years ago

@francesco98 could you please elaborate?

gbittmann commented 8 years ago

I think he might be asking what I'm about to ask.

Can you validate a JWT token from the javascript client with this project? People who were using gitkit for authentication are now going to be using Firebase authentication so this should come up a lot.

Basically a php variation of the functionality provided currently in the Java and Node SDKs.

https://firebase.google.com/docs/auth/server#verify_id_tokens

String idToken;  // Get the user's ID token from the client app

FirebaseAuth.getInstance().verifyIdToken(idToken)
    .addOnSuccessListener(new OnSuccessListener<FirebaseToken>() {
        @Override
        public void onSuccess(FirebaseToken decodedToken) {
          String uid = decodedToken.getUid();
          // ...
        }
});
tiagojlara commented 8 years ago

+1

jonmalave commented 8 years ago

Any plans to add user authentication?

ruudboon commented 7 years ago

+1

gusdevops commented 7 years ago

+1