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