OIDC::Lite::Model::IDToken - model class that represents ID token
JWT Header
JWT Payload
Key for JWT Signature
Constructor
my $id_token = OIDC::Lite::Model::IDToken->new(); ... my $id_token = OIDC::Lite::Model::IDToken->new( header => \%header, payload => \%payload, key => $key, alg => $alg, );
generate signature and return ID Token string.
my $id_token_string = $id_token->get_token_string();
$id_token->code_hash($access_token);
Set Authorization Code Hash to ID Token.
$id_token->code_hash($authorization_code);
load ID Token object from token string
my $token_string = 'eyJhbGciOiJub25lIiwidHlwIjoiSldTIn0.eyJmb28iOiJiYXIifQ.'; my $id_token = OIDC::Lite::Model::IDToken->load($token_string);
verify token signature.
my $token_string = '...'; my $alg = 'HS256'; my $key = 'shared_secret_key'; my $id_token = OIDC::Lite::Model::IDToken->load($token_string, $key, $alg); unless($id_token->verify()){ # validation failed }
Ryo Ito, <ritou.06@gmail.com>
Copyright (C) 2012 by Ryo Ito
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install OIDC::Lite, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OIDC::Lite
CPAN shell
perl -MCPAN -e shell install OIDC::Lite
For more information on module installation, please visit the detailed CPAN module installation guide.