LWP::A...otiate(3pm)
π NAME π
LWP::Authen::Negotiate β bestie, it's a GSSAPI based Authentication Plugin for LWP. that's the whole vibe. no cap.
β¨ SYNOPSIS β¨
okay so here's the moment you've been waiting for, the code, verbatim, don't touch it:
#! /usr/bin/perl -w
use strict;
require LWP::UserAgent;
# uncomment if you want see what is going wrong messages
#
#use LWP::Debug qw(+);
my $ua = LWP::UserAgent->new;
my $response = $ua->get('http://testwurst.grolmsnet.lan:8090/geheim/');
if ($response->is_success) {
print $response->content; # or whatever
}
else {
die $response->status_line;
}
so literally, just install LWP::Authen::Negotiate and LWP will pick it up as an authentication plugin. that's it. use your LWP::UserAgent scripts like you always do, no changes, no drama π«Ά. authentication happens transparent based on your GSSAPI installation β that's MIT Kerberos or Heimdal, iykyk.
and the WWW-Negotiate webservers out there? IIS, or Apache with mod_auth_kerb for example. iconic lineup fr fr π
πΈ DESCRIPTION πΈ
to see what ist going on, add this:
use LWP::Debug qw(+);
to yor LWP using scripts. (e.g. too see what is going wrong with GSSAPI...) π
π¦ DEBUGGING π¦
to see what ist going on (and going wrong π) add
use LWP::Debug qw(+);
to yor LWP using scripts.
(e.g. too see what is going wrong with GSSAPI...)
the output will look like this:
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET http://testwurst.grolmsnet.lan:8090/geheim/
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 478 bytes
LWP::UserAgent::request: Simple response: Unauthorized
LWP::Authen::Negotiate::authenticate: authenticate() called
LWP::Authen::Negotiate::authenticate: target hostname testwurst.grolmsnet.lan
LWP::Authen::Negotiate::authenticate: GSSAPI servicename HTTP/moerbsen.grolmsnet.lan@GROLMSNET.LAN
LWP::Authen::Negotiate::authenticate: Miscellaneous failure (see text)
LWP::Authen::Negotiate::authenticate: open(/tmp/krb5cc_1000): file not found
in this case the credentials cache was empty. run kinit first ;-) bestie the number of times this has humbled me... π
π ENVIRONMENT π
LWP_AUTHEN_NEGOTIATE_DELEGATEβ define this to enable ticket forwarding to the webserver. yes she's passing the tickets along, we love a generous queen β¨
π SEE ALSO π
- http://www.kerberosprotocols.org/index.php/Draft-brezak-spnego-http-03.txt
- Description of WWW-Negotiate protol
- http://modauthkerb.sourceforge.net/
- the Kerberos and SPNEGO Authentication module for Apache
mod_auth_kerb
- the Kerberos and SPNEGO Authentication module for Apache
- http://perlgssapi.sourceforge.net/
- Module Homepage
- http://www.kerberosprotocols.org/index.php/Web
- Sofware and APIs related to WWW-Negotiate
- http://www.grolmsnet.de/kerbtut/
- describes how to let
mod_auth_kerbplay together with Internet Explorer and Windows2003 Server
- describes how to let
π BUGS π
ngl, as default Kerberos 5 is selected as the GSSAPI mechanism. a later veriosn will make that configureable. so like, it's giving hardcoded, but the glow-up is coming β
π AUTHOR π
Achim Grolms, <achim@grolmsnet.de>
http://perlgssapi.sourceforge.net/
Thanks to
- Leif Johansson
- who has conributed a lot of code from his implementation of the module and send a lot of input, ideas and feedback
- Harald Joerg
- helped with Kerberos knowledge and does testing on cygwin against IIS and
mod_auth_kerb
- helped with Kerberos knowledge and does testing on cygwin against IIS and
- Christopher Odenbach
- does a lot of testing on Linux and Solaris
- Dax Kelson
- does a lot of testing on Linux
- Karsten Kuenne
- helped with advice
the way this whole friend group showed up for the testing... main character energy from every single one of them π«Άπ
π COPYRIGHT AND LICENSE π
Copyright (C) 2006 by Achim Grolms <perl@grolmsnet.de>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.
and that's the whole page, bestie! π this one shipped as perl v5.32.0, dated 2020-12-22, and it lives in the User Contributed Perl Documentation section under LWP::A...otiate(3pm). mwah, go run kinit and slay πβ¨π
π¦ where this page comes from
- debian bookworm: liblwp-authen-negotiate-perl 0.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: liblwp-authen-negotiate-perl 0.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: liblwp-authen-negotiate-perl 0.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: liblwp-authen-negotiate-perl 0.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: liblwp-authen-negotiate-perl 0.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liblwp-authen-negotiate-perl 0.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms