--- /dev/null
+use Module::Build;
+my $build = Module::Build->new(
+ module_name => 'Lemonldap::NG::Portal::Auth::My::Kerberos',
+ license => 'perl',
+);
+$build->create_build_script;
--- /dev/null
+The Debian Package liblemonldap-ng-portal-auth-my-kerberos-perl
+----------------------------
+
+This package contains the custom authentication portal code for lemonldap-ng
+
+ -- Michael Howe <michael@michaelhowe.org> Tue, 19 May 2020 16:13:11 +0100
--- /dev/null
+liblemonldap-ng-portal-auth-my-kerberos-perl (1.0~test.0) unstable; urgency=medium
+
+ * Initial Release.
+
+ -- Michael Howe <michael@michaelhowe.org> Tue, 19 May 2020 16:13:11 +0100
--- /dev/null
+Source: liblemonldap-ng-portal-auth-my-kerberos-perl
+Section: perl
+Priority: optional
+Maintainer: Michael Howe <michael@michaelhowe.org>
+Build-Depends: debhelper (>= 11)
+Build-Depends-Indep: perl (>= 5.10.0), libmodule-build-perl
+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
+Architecture: all
+Depends: ${misc:Depends}, ${perl:Depends}, liblemonldap-ng-portal-perl, libauthen-krb5-simple-perl
+Description: Custom Kerberos class for lemonldap-ng
+ This package provides a custom Kerberos class for liblemonldap-ng.
+ .
+ It allows GSSAPI authentication.
--- /dev/null
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: liblemonldap-ng-portal-auth-my-kerberos-perl
+Source: <url://example.com>
+
+Files: *
+Copyright: <years> <put author's name and email here>
+ <years> <likewise for another author>
+License: GPL-3.0+
+
+Files: debian/*
+Copyright: 2020 Michael Howe <michael@michaelhowe.org>
+License: GPL-3.0+
+
+License: GPL-3.0+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
+# Please avoid picking licenses with terms that are more restrictive than the
+# packaged work, as it may make Debian's contributions unacceptable upstream.
--- /dev/null
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#export DH_VERBOSE = 1
+
+
+# see FEATURE AREAS in dpkg-buildflags(1)
+#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+# see ENVIRONMENT in dpkg-buildflags(1)
+# package maintainers to append CFLAGS
+#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+# package maintainers to append LDFLAGS
+#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
+
+%:
+ dh $@
+
+
+# dh_make generated override targets
+# This is example for Cmake (See https://bugs.debian.org/641051 )
+#override_dh_auto_configure:
+# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
+
--- /dev/null
+3.0 (native)
--- /dev/null
+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;
+