We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e542a5 commit 656abe6Copy full SHA for 656abe6
decode-header.php
@@ -0,0 +1,18 @@
1
+<?php
2
+// https://github.com/BaseMax/php-jwt-example
3
+require 'vendor/autoload.php';
4
+use \Firebase\JWT\JWT;
5
+use \Firebase\JWT\SignatureInvalidException;
6
+$key = '83aeee518617ad6f3393bf0685e37d3e';
7
+
8
+$headers=getallheaders();
9
+// LOG: print_r($headers);
10
+if(!isset($headers["Authorization"])) {
11
+ exit("No 'Authorization' header!\n");
12
+}
13
14
+$token = $headers["Authorization"];
15
+$token = str_replace("Bearer ", "", $token); // or remove 'Bearer ' from first of letters!
16
17
+$decode = JWT::decode($jwt, $key, array('HS256'));
18
+print $decode;
0 commit comments