Skip to content

Instantly share code, notes, and snippets.

@mikejholly
Last active December 19, 2015 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikejholly/5959425 to your computer and use it in GitHub Desktop.
Save mikejholly/5959425 to your computer and use it in GitHub Desktop.
<?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