{
    "mode": "perldoc",
    "parameter": "Authen::SASL::Perl::GSSAPI",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Authen%3A%3ASASL%3A%3APerl%3A%3AGSSAPI/json",
    "generated": "2026-06-10T16:29:02Z",
    "synopsis": "use Authen::SASL qw(Perl);\n$sasl = Authen::SASL->new( mechanism => 'GSSAPI' );\n$sasl = Authen::SASL->new( mechanism => 'GSSAPI',\ncallback => { pass => $mycred });\n$sasl->clientstart( $service, $host );",
    "sections": {
        "NAME": {
            "content": "Authen::SASL::Perl::GSSAPI - GSSAPI (Kerberosv5) Authentication class\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Authen::SASL qw(Perl);\n\n$sasl = Authen::SASL->new( mechanism => 'GSSAPI' );\n\n$sasl = Authen::SASL->new( mechanism => 'GSSAPI',\ncallback => { pass => $mycred });\n\n$sasl->clientstart( $service, $host );\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This method implements the client part of the GSSAPI SASL algorithm, as described in RFC 2222\nsection 7.2.1 resp. draft-ietf-sasl-gssapi-XX.txt.\n\nWith a valid Kerberos 5 credentials cache (aka TGT) it allows to connect to *service*@*host*\ngiven as the first two parameters to Authen::SASL's clientstart() method. Alternatively, a\nGSSAPI::Cred object can be passed in via the Authen::SASL callback hash using the `pass' key.\n\nPlease note that this module does not currently implement a SASL security layer following\nauthentication. Unless the connection is protected by other means, such as TLS, it will be\nvulnerable to man-in-the-middle attacks. If security layers are required, then the\nAuthen::SASL::XS GSSAPI module should be used instead.\n\nCALLBACK\nThe callbacks used are:\n\nauthname\nThe authorization identity to be used in SASL exchange\n\ngssmech\nThe GSS mechanism to be used in the connection\n\npass\nThe GSS credentials to be used in the connection (optional)\n",
            "subsections": []
        },
        "EXAMPLE": {
            "content": "#! /usr/bin/perl -w\n\nuse strict;\n\nuse Net::LDAP 0.33;\nuse Authen::SASL 2.10;\n\n# -------- Adjust to your environment --------\nmy $adhost      = 'theserver.bla.net';\nmy $ldapbase   = 'dc=bla,dc=net';\nmy $ldapfilter = '(&(sAMAccountName=BLAAGROL))';\n\nmy $sasl = Authen::SASL->new(mechanism => 'GSSAPI');\nmy $ldap;\n\neval {\n$ldap = Net::LDAP->new($adhost,\nonerror => 'die')\nor  die \"Cannot connect to LDAP host '$adhost': '$@'\";\n$ldap->bind(sasl => $sasl);\n};\n\nif ($@) {\nchomp $@;\ndie   \"\\nBind error         : $@\",\n\"\\nDetailed SASL error: \", $sasl->error,\n\"\\nTerminated\";\n}\n\nprint \"\\nLDAP bind() succeeded, working in authenticated state\";\n\nmy $mesg = $ldap->search(base   => $ldapbase,\nfilter => $ldapfilter);\n\n# -------- evaluate $mesg\n\nPROPERTIES\nThe properties used are:\n\nmaxbuf\nThe maximum buffer size for receiving cipher text\n\nminssf\nThe minimum SSF value that should be provided by the SASL security layer. The default is 0\n\nmaxssf\nThe maximum SSF value that should be provided by the SASL security layer. The default is\n231\n\nexternalssf\nThe SSF value provided by an underlying external security layer. The default is 0\n\nssf The actual SSF value provided by the SASL security layer after the SASL authentication phase\nhas been completed. This value is read-only and set by the implementation after the SASL\nauthentication phase has been completed.\n\nmaxout\nThe maximum plaintext buffer size for sending data to the peer. This value is set by the\nimplementation after the SASL authentication phase has been completed and a SASL security\nlayer is in effect.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Authen::SASL, Authen::SASL::Perl\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Written by Simon Wilkinson, with patches and extensions by Achim Grolms and Peter Marschall.\n\nPlease report any bugs, or post any suggestions, to the perl-ldap mailing list\n<perl-ldap@perl.org>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (c) 2006 Simon Wilkinson, Achim Grolms and Peter Marschall. All rights reserved. This\nprogram is free software; you can redistribute it and/or modify it under the same terms as Perl\nitself.\n",
            "subsections": []
        }
    },
    "summary": "Authen::SASL::Perl::GSSAPI - GSSAPI (Kerberosv5) Authentication class",
    "flags": [],
    "examples": [
        "#! /usr/bin/perl -w",
        "use strict;",
        "use Net::LDAP 0.33;",
        "use Authen::SASL 2.10;",
        "# -------- Adjust to your environment --------",
        "my $adhost      = 'theserver.bla.net';",
        "my $ldapbase   = 'dc=bla,dc=net';",
        "my $ldapfilter = '(&(sAMAccountName=BLAAGROL))';",
        "my $sasl = Authen::SASL->new(mechanism => 'GSSAPI');",
        "my $ldap;",
        "eval {",
        "$ldap = Net::LDAP->new($adhost,",
        "onerror => 'die')",
        "or  die \"Cannot connect to LDAP host '$adhost': '$@'\";",
        "$ldap->bind(sasl => $sasl);",
        "};",
        "if ($@) {",
        "chomp $@;",
        "die   \"\\nBind error         : $@\",",
        "\"\\nDetailed SASL error: \", $sasl->error,",
        "\"\\nTerminated\";",
        "print \"\\nLDAP bind() succeeded, working in authenticated state\";",
        "my $mesg = $ldap->search(base   => $ldapbase,",
        "filter => $ldapfilter);",
        "# -------- evaluate $mesg",
        "PROPERTIES",
        "The properties used are:",
        "maxbuf",
        "The maximum buffer size for receiving cipher text",
        "minssf",
        "The minimum SSF value that should be provided by the SASL security layer. The default is 0",
        "maxssf",
        "The maximum SSF value that should be provided by the SASL security layer. The default is",
        "231",
        "externalssf",
        "The SSF value provided by an underlying external security layer. The default is 0",
        "ssf The actual SSF value provided by the SASL security layer after the SASL authentication phase",
        "has been completed. This value is read-only and set by the implementation after the SASL",
        "authentication phase has been completed.",
        "maxout",
        "The maximum plaintext buffer size for sending data to the peer. This value is set by the",
        "implementation after the SASL authentication phase has been completed and a SASL security",
        "layer is in effect."
    ],
    "see_also": []
}