I have service in php that return token with custom data (authentication data):
include_once "FirebaseToken.php";
$secret = "***********";
$tokenGen = new Services_FirebaseTokenGenerator($secret);
$token = $tokenGen->createToken(array("name" => "ADMIN"),array( admin => true));
echo $token;
Then in angular i have function for login:
adminlogin: function(){
var token;
$http.get("http://****").success(function(data){token=data;})
.then(function(){
var dataRef = new Firebase(FBURL);
dataRef.auth(token, function(error) {
if(error) {
console.log("Login Failed!", error);
} else {
console.log("DISPLAY name FROM TOKEN");
}
});
})
And after authentication i want to show name from token. How to access to authentication data from token ?