Fix paths in make_json
[scpubgit/stemmaweb.git] / t / script / make_json.pl
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;
8 use FindBin;
9
10 use IO::All;
11
12 my $cert = io("$FindBin::Bin/../etc/certonly.pem")->slurp;
13 my $priv = io("$FindBin::Bin/../etc/privkey")->slurp;
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;