From: Michael Howe Date: Thu, 23 Jul 2020 20:16:32 +0000 (+0100) Subject: Kerberos -> KerberosAuth X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=9e30a63cc7861bbb83d7d703c62728d517c41b65;p=packages%2Flibl%2Fliblemonldap-ng-portal-auth-my-kerberos-perl.git Kerberos -> KerberosAuth Otherwise you get weird collisions with the shipped Kerberos module --- diff --git a/Build.PL b/Build.PL index d64e84b..547a22b 100644 --- a/Build.PL +++ b/Build.PL @@ -1,6 +1,6 @@ use Module::Build; my $build = Module::Build->new( - module_name => 'Lemonldap::NG::Portal::Auth::My::Kerberos', + module_name => 'Lemonldap::NG::Portal::Auth::My::KerberosAuth', license => 'perl', ); $build->create_build_script; diff --git a/debian/changelog b/debian/changelog index a39b77b..4ac4756 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,7 @@ -liblemonldap-ng-portal-auth-my-kerberos-perl (1.0~test.0) unstable; urgency=medium +liblemonldap-ng-portal-auth-my-kerberosauth-perl (1.0~test.1) unstable; urgency=medium * Initial Release. + * Rename because there are collisions with the Kerberos name, so use + KerberosAuth instead -- Michael Howe Tue, 19 May 2020 16:13:11 +0100 diff --git a/debian/control b/debian/control index c39045a..89dd3a6 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: liblemonldap-ng-portal-auth-my-kerberos-perl +Source: liblemonldap-ng-portal-auth-my-kerberosauth-perl Section: perl Priority: optional Maintainer: Michael Howe @@ -8,9 +8,10 @@ Standards-Version: 4.1.3 #Vcs-Browser: https://salsa.debian.org/debian/liblemonldap-ng-portal-auth-my-kerberos-perl #Vcs-Git: https://salsa.debian.org/debian/liblemonldap-ng-portal-auth-my-kerberos-perl.git -Package: liblemonldap-ng-portal-auth-my-kerberos-perl +Package: liblemonldap-ng-portal-auth-my-kerberosauth-perl Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, liblemonldap-ng-portal-perl, libauthen-krb5-simple-perl +Replaces: liblemonldap-ng-portal-auth-my-kerberos-perl Description: Custom Kerberos class for lemonldap-ng This package provides a custom Kerberos class for liblemonldap-ng. . diff --git a/lib/Lemonldap/NG/Portal/Auth/My/Kerberos.pm b/lib/Lemonldap/NG/Portal/Auth/My/Kerberos.pm deleted file mode 100644 index 0769299..0000000 --- a/lib/Lemonldap/NG/Portal/Auth/My/Kerberos.pm +++ /dev/null @@ -1,61 +0,0 @@ -package Lemonldap::NG::Portal::Auth::My::Kerberos; - -use strict; -use Mouse; -use Authen::Krb5::Simple; -#use Data::Dumper; -use Lemonldap::NG::Portal::Main::Constants qw( - PE_BADCREDENTIALS - PE_ERROR - PE_OK -); - -#extends qw(Lemonldap::NG::Portal::Main::Auth); -extends qw(Lemonldap::NG::Portal::Auth::_WebForm); - -our $VERSION = '1.0.0'; - -# INITIALIZATION - -# RUNNING METHODS - -sub init { - my $self = shift; - return $self->Lemonldap::NG::Portal::Auth::_WebForm::init(); -} -#sub extractFormInfo { -# return PE_OK; -#} - -sub authenticate { - my ( $self, $req ) = @_; - -# $self->userLogger->error( Dumper( $req ) ); - my $krb5 = Authen::Krb5::Simple->new(); - my $authen = $krb5->authenticate( $req->{user}, $req->data->{password} ); - - if( $authen ){ -# $req->user( $req->{user} ); - $self->userLogger->notice("Good Kerberos authentication for $req->{user}"); - return PE_OK; - } else { - $self->userLogger->error("Kerberos authentication for $req->{user} failed: " . $krb5->errstr()); - return PE_BADCREDENTIALS; - } -} - -sub setAuthSessionInfo { - my ( $self, $req ) = @_; - $req->sessionInfo->{authenticationLevel} = 2; - PE_OK; -} - -sub authLogout { - PE_OK; -} - -#sub getDisplayType { -# return 1; -#} -1; - diff --git a/lib/Lemonldap/NG/Portal/Auth/My/KerberosAuth.pm b/lib/Lemonldap/NG/Portal/Auth/My/KerberosAuth.pm new file mode 100644 index 0000000..2afddde --- /dev/null +++ b/lib/Lemonldap/NG/Portal/Auth/My/KerberosAuth.pm @@ -0,0 +1,61 @@ +package Lemonldap::NG::Portal::Auth::My::KerberosAuth; + +use strict; +use Mouse; +use Authen::Krb5::Simple; +#use Data::Dumper; +use Lemonldap::NG::Portal::Main::Constants qw( + PE_BADCREDENTIALS + PE_ERROR + PE_OK +); + +#extends qw(Lemonldap::NG::Portal::Main::Auth); +extends qw(Lemonldap::NG::Portal::Auth::_WebForm); + +our $VERSION = '1.0.0'; + +# INITIALIZATION + +# RUNNING METHODS + +sub init { + my $self = shift; + return $self->Lemonldap::NG::Portal::Auth::_WebForm::init(); +} +#sub extractFormInfo { +# return PE_OK; +#} + +sub authenticate { + my ( $self, $req ) = @_; + +# $self->userLogger->error( Dumper( $req ) ); + my $krb5 = Authen::Krb5::Simple->new(); + my $authen = $krb5->authenticate( $req->{user}, $req->data->{password} ); + + if( $authen ){ +# $req->user( $req->{user} ); + $self->userLogger->notice("Good Kerberos authentication for $req->{user}"); + return PE_OK; + } else { + $self->userLogger->error("Kerberos authentication for $req->{user} failed: " . $krb5->errstr()); + return PE_BADCREDENTIALS; + } +} + +sub setAuthSessionInfo { + my ( $self, $req ) = @_; + $req->sessionInfo->{authenticationLevel} = 2; + PE_OK; +} + +sub authLogout { + PE_OK; +} + +#sub getDisplayType { +# return 1; +#} +1; +