Installing Perl Authen::OATH on CentOS 6.4

13 posts / 0 new
Last post
#1 Fri, 10/11/2013 - 16:30
eddieb

Installing Perl Authen::OATH on CentOS 6.4

I'm trying to install Authen::OATH to use Google Two Factor Auth.

Using the Perl Module to install "Authen::OATH" fails in the first test

Executing make test ..

                                                                                                   
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/ar
ch')" t/*.t
Bailout called.  Further testing stopped: 

#   Failed test 'use Authen::OATH;'
#   at t/00-load.t line 6.
#     Tried to use 'Authen::OATH'.
#     Error:  Can't locate Moose.pm in @INC (@INC contains: /tmp/.webmin/Authen-OATH-v1.0.0/blib/lib
/tmp/.webmin/Authen-OATH-v1.0.0/blib/arch /usr/libexec/webmin /usr/local/lib64/perl5 /usr/local/sha
re/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5
) at /tmp/.webmin/Authen-OATH-v1.0.0/blib/lib/Authen/OATH.pm line 18.
# BEGIN failed--compilation aborted at /tmp/.webmin/Authen-OATH-v1.0.0/blib/lib/Authen/OATH.pm line
18.
# Compilation failed in require at (eval 4) line 2.
# BEGIN failed--compilation aborted at (eval 4) line 2.
# Testing Authen::OATH , Perl 5.010001, /usr/bin/perl
# Looks like you failed 1 test of 1.
FAILED--Further testing stopped.
make: *** [test_dynamic] Error 1

Using "perl -MCPAN -e shell" followed by "install Authen::OATH" takes me thru dozens of prompts for dependencies, but it finally fails at:

Test Summary Report
-------------------
t/Carp_overload.t  (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 7 tests but ran 0.
Files=14, Tests=187,  0 wallclock secs ( 0.08 usr  0.05 sys +  0.26 cusr  0.10 csys =  0.49 CPU)
Result: FAIL
Failed 1/14 test programs. 0/187 subtests failed.
make: *** [test_dynamic] Error 255
  ZEFRAM/Carp-1.32.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports ZEFRAM/Carp-1.32.tar.gz
Running make install
  make test had returned bad status, won't install without force
Stopping: 'install' failed for 'Carp'.
Failed during this command:
ZEFRAM/Carp-1.32.tar.gz                      : make_test NO

I don't want to force any install, I would like to do this gracefully. Any tips?

Thank you

Webmin 1.66 Virtualmin 4.02GPL CentOS 6.4

Sun, 10/20/2013 - 07:10
dlage

Hello,

How'd you like to install the module?

The error you are getting is because you don't have perl-Moose installed. If you have the EPEL repos activated, go ahead and:

yum install perl-Moose

And then try again.

If you want to build the RPM it might require a bit more work but is, imo, better. I've built the rpm package, maybe you can try to use it. Here are the rpm and the source archive I used to build the rpm package:

Source: http://demo.senolage.net/rpmbuild/SOURCES/perl-Authen-OATH-1.0.0.tar.bz2

RPM: http://demo.senolage.net/rpmbuild/RPMS/noarch/perl-Authen-OATH-1.0.0-1.e...

Please report if this worked for you.

Also, make sure you have time sync enabled on your server (ntp), otherwise the authentication won't work.

Regards, Dinis

Mon, 10/21/2013 - 10:13
eddieb

I installed perl:Moose from EPEL, but it still failed.

Installed Packages
Name        : perl-Moose
Arch        : x86_64
Version     : 1.15
Release     : 1.el6
Size        : 1.3 M
Repo        : installed
From repo   : epel
cpan[1]> install Authen::OATH
CPAN: Storable loaded ok (v2.20)
Reading '/root/.cpan/Metadata'
  Database was generated on Sun, 20 Oct 2013 18:09:07 GMT
Running install for module 'Authen::OATH'
Running make for S/SI/SIFUKURT/Authen-OATH-v1.0.0.tar.gz
CPAN: Digest::SHA loaded ok (v5.71)
CPAN: Compress::Zlib loaded ok (v2.052)
Checksum for /root/.cpan/sources/authors/id/S/SI/SIFUKURT/Authen-OATH-v1.0.0.tar.gz ok
Scanning cache /root/.cpan/build for sizes
............................................................................DONE
CPAN: Archive::Tar loaded ok (v1.88)
Authen-OATH-v1.0.0
Authen-OATH-v1.0.0/Build.PL
Authen-OATH-v1.0.0/Changes
Authen-OATH-v1.0.0/Makefile.PL
Authen-OATH-v1.0.0/MANIFEST
Authen-OATH-v1.0.0/META.yml
Authen-OATH-v1.0.0/README
Authen-OATH-v1.0.0/lib
Authen-OATH-v1.0.0/lib/Authen
Authen-OATH-v1.0.0/lib/Authen/OATH.pm
Authen-OATH-v1.0.0/t
Authen-OATH-v1.0.0/t/00-load.t
Authen-OATH-v1.0.0/t/01-cases.t
Authen-OATH-v1.0.0/t/manifest.t
Authen-OATH-v1.0.0/t/pod-coverage.t
Authen-OATH-v1.0.0/t/pod.t
CPAN: File::Temp loaded ok (v0.22)
CPAN: Parse::CPAN::Meta loaded ok (v1.4404)
CPAN: CPAN::Meta loaded ok (v2.132830)
CPAN: Module::CoreList loaded ok (v2.68)
CPAN: Module::Build loaded ok (v0.4001)

  CPAN.pm: Building S/SI/SIFUKURT/Authen-OATH-v1.0.0.tar.gz

Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Authen-OATH' version 'v1.0.0'
Building Authen-OATH
  SIFUKURT/Authen-OATH-v1.0.0.tar.gz
  ./Build -- OK
CPAN: YAML loaded ok (v0.81)
Running Build test
Use of uninitialized value $Test::Harness::Switches in length at /usr/local/share/perl5/Module/Build/Base.pm line 2767.
t/00-load.t ....... 1/1
#   Failed test 'use Authen::OATH;'
#   at t/00-load.t line 6.
#     Tried to use 'Authen::OATH'.
#     Error:  Can't locate object method "get_or_add_package_symbol" via package "Package::Stash" at /usr/lib64/perl5/vendor_perl/Class/MOP/Package.pm line 128.
# Compilation failed in require at /usr/lib64/perl5/vendor_perl/Moose/Exporter.pm line 11.
# BEGIN failed--compilation aborted at /usr/lib64/perl5/vendor_perl/Moose/Exporter.pm line 11.
# Compilation failed in require at /usr/lib64/perl5/vendor_perl/Moose.pm line 15.
# BEGIN failed--compilation aborted at /usr/lib64/perl5/vendor_perl/Moose.pm line 15.
# Compilation failed in require at /root/.cpan/build/Authen-OATH-v1.0.0-Ek1Jel/blib/lib/Authen/OATH.pm line 18.
# BEGIN failed--compilation aborted at /root/.cpan/build/Authen-OATH-v1.0.0-Ek1Jel/blib/lib/Authen/OATH.pm line 18.
# Compilation failed in require at (eval 4) line 2.
# BEGIN failed--compilation aborted at (eval 4) line 2.
Bailout called.  Further testing stopped:
# Testing Authen::OATH , Perl 5.010001, /usr/bin/perl
# Looks like you failed 1 test of 1.
FAILED--Further testing stopped.
  SIFUKURT/Authen-OATH-v1.0.0.tar.gz
  ./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports SIFUKURT/Authen-OATH-v1.0.0.tar.gz
Running Build install
  make test had returned bad status, won't install without force
Stopping: 'install' failed for 'Authen::OATH'.
Failed during this command:
SIFUKURT/Authen-OATH-v1.0.0.tar.gz           : make_test NO
Tue, 10/22/2013 - 05:24
dlage

Hello, I believe you might be missing some packages and it seems like some dependencies are missing.

I think the following packages should be installed before build:

yum install 'perl(Moose)'
yum install 'perl(Digest::HMAC)'
yum install 'perl(Module::Build)'

I'm not sure whether the install through CPAN is working or not, but I'd advise you to either:

To install this module, run the following commands:

perl Build.PL
./Build
./Build test
./Build install
Tue, 10/22/2013 - 12:47
eddieb

I did yum install 'perl(Moose)': sucessfully installed yum install 'perl(Digest::HMAC)': already installed and latest. yum install 'perl(Module::Build)': sucessfully installed

then "rpm -ivh perl-Authen-OATH-1.0.0-1.el6.noarch.rpm", which showed 100%.

But webmin still says "Authen::OATH needed for two-factor authentication is not installed".

Tue, 10/22/2013 - 14:12
dlage

You should probably restart webmin after that to see if it gets.

Anyway, you can run:

perl -e 'use Authen::OATH;'

and check that it found the module (no output is good). Otherwise, maybe paste the output here.

Tue, 10/22/2013 - 15:14 (Reply to #6)
eddieb
Can't locate object method "get_or_add_package_symbol" via package "Package::Stash" at /usr/lib64/perl5/vendor_perl/Class/MOP/Package.pm line 128.
Compilation failed in require at /usr/lib64/perl5/vendor_perl/Moose/Exporter.pm line 11.
BEGIN failed--compilation aborted at /usr/lib64/perl5/vendor_perl/Moose/Exporter.pm line 11.
Compilation failed in require at /usr/lib64/perl5/vendor_perl/Moose.pm line 15.
BEGIN failed--compilation aborted at /usr/lib64/perl5/vendor_perl/Moose.pm line 15.
Compilation failed in require at /usr/share/perl5/vendor_perl/Authen/OATH.pm line 18.
BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/Authen/OATH.pm line 18.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
Tue, 10/22/2013 - 15:17 (Reply to #7)
eddieb

perl -e 'use Package::Stash;' brings no output.

Tue, 10/29/2013 - 20:15 (Reply to #8)
eddieb

whats the next step to try!? i don't want to build from source...

Wed, 10/30/2013 - 22:51
eddieb

would someone please tell how to password protect (like basic auth) the webmin login page?!

i can't get 2FA running and absolutely can't have it exposed anymore. i need to setup a very strong password for the "pre-auth", which can be memorized by my browser, then just use my strong (but rememberable) webmin login. i already changed the username from the default.

thanks

Fri, 11/01/2013 - 18:36
eddieb

Does Authy also require Authen::OATH?

Do I need to register as a developer to get an Authy API key?

Thanks

Wed, 12/04/2013 - 16:49
eddieb

Since I cannot get 2FA to work, could someone at least tell me how to password protect the login page?

Thanks

Mon, 04/04/2016 - 01:38
km

I used to have the same problem. To get 2FA to work,

  1. you need gcc. yum install gcc
  2. get CPAN. yum install CPAN
  3. configure CPAN ( just run CPAN )
  4. after CPAN is configured, install Authen::OATH module in CPAN shell, which takes a long time to complete.
  5. When Authen::OATH is successfully installed, configure 2FA in WebMin.
Topic locked