Added Firebase JWT and secret generation

This commit is contained in:
2022-06-01 07:45:19 -04:00
parent 6949150647
commit 320cbb11ee
2 changed files with 32 additions and 2 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
chdir('..');
require 'vendor/autoload.php';
use Firebase\JWT\JWT;
$teamId = 'JR363FEY8R';
$keyId = 'W5WTWC9DTJ';
$sub = 'com.wrenchboard.users.client';
$aud = 'https://appleid.apple.com'; // it's a fixed URL value
$iat = strtotime('now');
$exp = strtotime('+60days');
$keyContent = file_get_contents('/home/oameye/AuthKey_W5WTWC9DTJ.p8');
echo JWT::encode([
'iss' => $teamId,
'iat' => $iat,
'exp' => $exp,
'aud' => $aud,
'sub' => $sub,
], $keyContent, 'ES256', $keyId);
// Write the snippet in a method, return the value from that method
// You
?>