Skip to content

Commit

Permalink
Item13260: can't call KerberosLogin from cmd line
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Feb 16, 2015
1 parent ff11acb commit 6382e5e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions lib/Foswiki/Contrib/LdapContrib.pm
Expand Up @@ -30,8 +30,8 @@ use Encode ();
use Foswiki::Func ();
use Foswiki::Plugins ();

our $VERSION = '7.00';
our $RELEASE = '13 Feb 2015';
our $VERSION = '7.01';
our $RELEASE = '16 Feb 2015';
our %sharedLdapContrib;

=pod
Expand Down
29 changes: 14 additions & 15 deletions lib/Foswiki/LoginManager/KerberosLogin.pm
Expand Up @@ -20,6 +20,7 @@ use strict;
use warnings;

use Foswiki::Func();
use Foswiki::LoginManager::Session (); # SMELL: required for _loadCreateCGISession
use Foswiki::LoginManager::TemplateLogin();
our @ISA = qw( Foswiki::LoginManager::TemplateLogin );

Expand All @@ -38,8 +39,6 @@ sub writeDebug {
print STDERR "- KerberosLogin - $_[0]\n";
}

# see https://metacpan.org/source/AGROLMS/LWP-Authen-Negotiate-0.08/lib/LWP/Authen/Negotiate.pm

sub new {
my ($class, $session) = @_;

Expand All @@ -59,7 +58,7 @@ sub getSessionUser {
my $request = $this->{session}{request};
$this->{_cgisession} = $this->_loadCreateCGISession($request)
unless $this->{_cgisession};

my $user = Foswiki::Sandbox::untaintUnchecked($this->{_cgisession}->param('AUTHUSER'));

if ($user) {
Expand Down Expand Up @@ -96,7 +95,7 @@ sub login {
} else {
writeDebug("force into auth loop");
$response->header(
-status => 401,
-status => 401,
);
}
}
Expand Down Expand Up @@ -151,20 +150,20 @@ sub getUser {
TRY: {
writeDebug("calling accept context");
$status = GSSAPI::Context::accept(
$context,
GSS_C_NO_CREDENTIAL,
$inToken,
GSS_C_NO_CHANNEL_BINDINGS,
my $src_name,
undef,
my $gss_output_token,
undef,
undef,
$context,
GSS_C_NO_CREDENTIAL,
$inToken,
GSS_C_NO_CHANNEL_BINDINGS,
my $src_name,
undef,
my $gss_output_token,
undef,
undef,
undef
);

# bail out on error
$status or last;
$status or last;

writeDebug("getting client name");
$status = $src_name->display($user);
Expand Down Expand Up @@ -193,7 +192,7 @@ sub getStatusMessage {

$text .= join("\n", map {"MAJOR: $_"} $status->generic_message());
$text .= "\n".join("\n", map {"MINOR: $_"} $status->specific_message());

return $text;
}

Expand Down

0 comments on commit 6382e5e

Please sign in to comment.