How to Verify a Google API JWT with Firebase\JWT (Oauth) in PHP

Viewed 211

How can I decode a JWT generated by Google using Firebase JWT in PHP?

I am trying to decode a JWT from Google API in a PHP endpoint:

use \Firebase\JWT\JWT; 

$decoded = JWT::decode($jwt, $secret, array('RS256'));

However, I get the error: "OpenSSL error: error:0909006C:PEM routines:get_name:no start line"

I can't get the jwt to be verified at jwt.io, either: Unable to verify Google JWT

This is where I got the secret from

I am able to decode my own HS256 JWTs using this method without any problems.

0 Answers
Related