Skip to content

Instantly share code, notes, and snippets.

View heri16's full-sized avatar

Heri Sim heri16

View GitHub Profile
@heri16
heri16 / cognito-decode-jwt-token.php
Last active February 9, 2019 08:06 — forked from jeffski/cognito-decode-jwt-token.php
Decode user identity from JWT Token
<?php
/**
* Assumes https://github.com/Spomky-Labs/jose library is installed: composer require spomky-labs/jose
* Check token claims guide: https://github.com/Spomky-Labs/jose/blob/master/doc/operation/Check.md
*/
use Jose\Checker\AudienceChecker;
use Jose\Factory\CheckerManagerFactory;
$claim_checker_list = [
// 'exp', // We should enable 'exp', but this example will fail as the token has already expired