Last active
December 19, 2015 13:08
-
-
Save mikejholly/5959425 to your computer and use it in GitHub Desktop.
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 | |
// Check for token | |
if (empty($_REQUEST['jwt'])) { | |
return drupal_not_found(); | |
} | |
// Load token | |
$payload = $_REQUEST['jwt']; | |
// Get credentials | |
$client_id = variable_get('strutta_jwt_client_id', '****'); | |
$secret = variable_get('strutta_jwt_secret', '****'); | |
// Decode JWT token | |
try { | |
$json = JWT::decode($payload, $secret); | |
} | |
catch (Exception $e) { | |
drupal_set_message($e); | |
return drupal_not_found(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment