Skip to content

Instantly share code, notes, and snippets.

@paulobunga
Created December 13, 2019 00:08
Show Gist options
  • Save paulobunga/809db74aa22d1915affc18fdfdfcd77a to your computer and use it in GitHub Desktop.
Save paulobunga/809db74aa22d1915affc18fdfdfcd77a to your computer and use it in GitHub Desktop.
Our test controller
<?php defined('BASEPATH') OR exit('No direct script access allowed');
use \Firebase\JWT\JWT;
Class Test extends CI_Controller
{
public function index()
{
$key = "example_key";
$token = array(
"iss" => "http://example.org",
"aud" => "http://example.com",
"iat" => 1356999524,
"nbf" => 1357000000
);
$jwt = JWT::encode($token, $key);
echo $jwt;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment