Commit | Line | Data |
bb1f8a40 |
1 | #!/usr/bin/env perl |
2 | |
3 | use warnings; |
4 | use strict; |
5 | use JSON::MaybeXS; |
6 | use stemmaweb::Authentication::Credential::Google; |
7 | use Crypt::OpenSSL::RSA; |
6b3d9f0d |
8 | use FindBin; |
bb1f8a40 |
9 | |
10 | use IO::All; |
11 | |
6b3d9f0d |
12 | my $cert = io("$FindBin::Bin/../etc/certonly.pem")->slurp; |
13 | my $priv = io("$FindBin::Bin/../etc/privkey")->slurp; |
bb1f8a40 |
14 | |
15 | my $hash = { 'a' => $cert }; |
16 | |
17 | warn encode_json($hash) . "\n\n\n\n\n"; |
18 | |
19 | my $jwt = JSON::WebToken->encode({ |
20 | sub => '4242', |
21 | openid_id => 'https://www.google.com/accounts/o8/id3', |
22 | }, $priv, 'RS256', { kid => 'a' }); |
23 | |
24 | use Data::Dumper; |
25 | warn $jwt . "\n\n\n\n\n"; |
26 | |
27 | warn Dumper (stemmaweb::Authentication::Credential::Google->decode($jwt, $hash)); |
28 | |
29 | 1; |