I am using PHP firebase JTW for implementation of JWT in my PHP app. Here is my code
$payload = [
'iss' => 'http://test.com',
'aud' => 'http://test.com',
'iat' => time(), // Issued at
'exp' => time() + 3600, // Expiration (1 hour)
'data' => [
'user_id' => $user['id'],
'email' => $user['email'],
'role' => $user['role'],
'is_admin' => $user['isadmin']
]
];
$jwt = JWT::encode($payload, $key, 'HS256', $key_file);
After encoding it generates the token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6Ii92YXIvd3d3L215a2V5LmtleSJ9.eyJpc3MiOiJodHRwOi8vdGVzdC5jb20iLCJhdWQiOiJodHRwOi8vdGVzdC5jb20iLCJpYXQiOjE3MjM5NzQ5OTMsImV4cCI6MTcyMzk3ODU5MywiZGF0YSI6eyJ1c2VyX2lkIjoxLCJlbWFpbCI6ImFiYyIsInJvbGUiOiJ1c2VyIiwiaXNfYWRtaW4iOjB9fQ.uC13pivSZGnPr6i8zmPCfEFMsykWR5miIK8t0-DCnug
which is fine
The content of key file are hellohellohellohellohellohellohe
I used the website https://jwt.io/ to test my token and several other websites https://dinochiesa.github.io/jwt/
Now I want a normal user to generate a token through any website by changing the key kid parameter and using any of the website on the internet, so it can be used on the site (demonstrating a vulnerability).
I am facing two issues; if I try to verify the token with the above key on any of the websites with the key file, it says it cannot match or verify; what is the issue? Does PHP Firebase based JWT works differently?
I also checked this one
JWT signature not verifying in PHP