We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79a3892 commit 653e334Copy full SHA for 653e334
detect-header.php
@@ -0,0 +1,12 @@
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
+$token='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdGF0dXMiOiJzdWNjZXNzIiwiZGF0YTEiOiJ0ZXN0MSIsImRhdGEyIjoidGVzdDIiLCJkYXRhMyI6InRlc3QzIiwiZGF0YTQiOiJ0ZXN0NCIsImRhdGE1IjoidGVzdDUifQ.nOa6tq6bDCiURP2GpTehux3geHiNiqQKJXaZ0M_uJ0WD0yTmKM66LS23fCAMraem58HWnmlX4V4WB7-eTfFpbQ';
9
+$tokens = explode('.', $token);
10
+list($headb64, $bodyb64, $cryptob64) = $tokens;
11
+$header = JWT::jsonDecode(Firebase\JWT\JWT::urlsafeB64Decode($headb64));
12
+var_dump($header);
0 commit comments