Skip to content

Instantly share code, notes, and snippets.

@paulobunga
Last active May 11, 2017 22:15
Show Gist options
  • Save paulobunga/6e6ac3ac304ed61a24da238ee285299f to your computer and use it in GitHub Desktop.
Save paulobunga/6e6ac3ac304ed61a24da238ee285299f to your computer and use it in GitHub Desktop.
Autoload firebase php-jwt library in CodeIgniter 3
<?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