Guest User

Untitled

a guest
Aug 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. Unexpected control character found
  2.  
  3. try {
  4. $secretKey = 'hayderZainCash';
  5. $headers = apache_request_headers();
  6. $token = $headers['Authorization'];
  7. $credintials = JWT::decode($token, $secretKey, array('HS256'));
  8. echo $credintials;
  9. } catch (Exception $e) {
  10. echo 'error ' . $e->getMessage();
  11. }
  12.  
  13. preg_match('/Bearers(S+)/', $headers['Authorization'], $matches);
  14. $token = $matches[0];
  15.  
  16. try
  17. {
  18. $secretKey = 'hayderZainCash';
  19. $headers = apache_request_headers();
  20. preg_match('/Bearers(S+)/', $headers['Authorization'], $matches);
  21. $credintials = JWT::decode($matches[0], $secretKey, array('HS256'));
  22.  
  23. print_r($credintials);
  24. }
  25. catch( Exception $e )
  26. {
  27. echo 'error ' . $e->getMessage();
  28. }
Add Comment
Please, Sign In to add comment