Added Firebase JWT and secret generation
This commit is contained in:
@@ -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
|
||||
|
||||
?>
|
||||
+3
-2
@@ -13,10 +13,11 @@
|
||||
"require": {
|
||||
"php": ">=5.3.7",
|
||||
"facebook/graph-sdk" : "^5.7",
|
||||
"firebase/php-jwt": "^5.5.1",
|
||||
"firebase/php-jwt": "^6.2",
|
||||
"phpseclib/phpseclib": "^3.0",
|
||||
"hybridauth/hybridauth" : "~3.7.1",
|
||||
"google/apiclient":"^2.12.1"
|
||||
"google/apiclient":"^2.12.1",
|
||||
"paragonie/sodium_compat": "^1.17"
|
||||
},
|
||||
"suggest": {
|
||||
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
|
||||
|
||||
Reference in New Issue
Block a user