PHP code example of firesphere / graphql-jwt

1. Go to this page and download the library: Download firesphere/graphql-jwt library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

firesphere / graphql-jwt example snippets

ini
JWT_SIGNER_KEY="[your secret key]"

php -r 'echo substr(base64_encode(random_bytes(64)), 0, 64) . "\n";'
yaml
SilverStripe\GraphQL\Controller:
  cors:
    Enabled: true
    Allow-Origin: "*"
    Allow-Headers: "Authorization, Content-Type"
    Allow-Methods: "GET, POST, OPTIONS"
    Max-Age: 86400 # ...in seconds