I am completely new to JWT and oAuth but after 8 hours of searching I am stuck. I have this code:
<?PHP
require_once '/home/site/PHP-JWT/vendor/autoload.php';
use \Firebase\JWT\JWT;
$jwt=$_SERVER['HTTP_X_MS_TOKEN_AAD_ID_TOKEN'];
$secret_key = "Where_to_find_this";
$decoded = JWT::decode($jwt, $secret_key, array('RS256'));
print_r($decoded);
?>
The $jwt variable has a proper token (jwt.io can decode it fine). What should I use for the $secret_key value? I keep reading it should be my Azure (or Azure AD) private key, but I've got no clue where to start looking for this. Besides: if jwt.io can decode this token without providing it any certificates, how can this be safe?