]> git.michaelhowe.org Git - packages/libl/liblemonldap-ng-portal-auth-my-kerberos-perl.git/commitdiff
Initial packaging of Lemonldap::NG::Portal::Auth::My::Kerberos
authorMichael Howe <michael@michaelhowe.org>
Tue, 19 May 2020 16:40:33 +0000 (17:40 +0100)
committerMichael Howe <michael@michaelhowe.org>
Tue, 19 May 2020 16:40:33 +0000 (17:40 +0100)
Build.PL [new file with mode: 0644]
debian/README [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/source/format [new file with mode: 0644]
lib/Lemonldap/NG/Portal/Auth/My/Kerberos.pm [new file with mode: 0644]

diff --git a/Build.PL b/Build.PL
new file mode 100644 (file)
index 0000000..d64e84b
--- /dev/null
+++ b/Build.PL
@@ -0,0 +1,6 @@
+use Module::Build;
+my $build = Module::Build->new(
+    module_name => 'Lemonldap::NG::Portal::Auth::My::Kerberos',
+    license     => 'perl',
+);
+$build->create_build_script;
diff --git a/debian/README b/debian/README
new file mode 100644 (file)
index 0000000..cfc0058
--- /dev/null
@@ -0,0 +1,6 @@
+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
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..a39b77b
--- /dev/null
@@ -0,0 +1,5 @@
+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
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..b4de394
--- /dev/null
@@ -0,0 +1 @@
+11
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..c39045a
--- /dev/null
@@ -0,0 +1,17 @@
+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.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..7a84511
--- /dev/null
@@ -0,0 +1,34 @@
+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.
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..e1c367c
--- /dev/null
@@ -0,0 +1,25 @@
+#!/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)
+
diff --git a/debian/source/format b/debian/source/format
new file mode 100644 (file)
index 0000000..89ae9db
--- /dev/null
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/lib/Lemonldap/NG/Portal/Auth/My/Kerberos.pm b/lib/Lemonldap/NG/Portal/Auth/My/Kerberos.pm
new file mode 100644 (file)
index 0000000..0769299
--- /dev/null
@@ -0,0 +1,61 @@
+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;
+