firebase verify token code example
Example 1: firebase jwt php verify
try {
$usertoken_to_verify = $_GET["usertoken"];
$decodejwt = JWT::decode($usertoken_to_verify, $key, array('HS256')); print_r($decodejwt);
} catch (\Exception $e) {
echo $e;
}
Example 2: how to verify sms token firebase
POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/getAccountInfo?key={FIREBASE_SERVER_KEY}
{
“idToken”: “eyJhbGciOiJEanNZspytaJL4wDZmu2OcwQujC360AJ_Q”
}
//result
{
…,
“users”: [
{
…,
“phoneNumber”: “+351966666666”,
…
}
]
}