Google Authenticator implementation in Perl

后端 未结 4 921
無奈伤痛
無奈伤痛 2021-02-06 19:02

I am looking for a simple Perl implementation that verifies a Google authenticator token that has been created using a server side secret. For instance,

The following Go

4条回答
  •  既然无缘
    2021-02-06 19:36

    Here's another solution, and you can verify it matches the tokens produced in this example

    use Authen::OATH;
    use Convert::Base32;
    my $oath = Authen::OATH->new();
    my $secret = "JBSWY3DPEHPK3PXP";
    my $otp = $oath->totp(  decode_base32( $secret ) );
    print $otp."\n";
    

提交回复
热议问题