Skip to content

Instantly share code, notes, and snippets.

Avatar

Heri Sim heri16

View GitHub Profile
@heri16
heri16 / cognito-decode-jwt-token.php
Last active Feb 9, 2019 — forked from jeffski/cognito-decode-jwt-token.php
Decode user identity from JWT Token
View cognito-decode-jwt-token.php
<?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