Last active
May 11, 2017 22:15
-
-
Save paulobunga/6e6ac3ac304ed61a24da238ee285299f to your computer and use it in GitHub Desktop.
Autoload firebase php-jwt library in CodeIgniter 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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