{
    "content": [
        {
            "type": "text",
            "text": "# Authen::SASL (perldoc)\n\n## NAME\n\nAuthen::SASL - SASL Authentication framework\n\n## SYNOPSIS\n\nuse Authen::SASL;\n$sasl = Authen::SASL->new(\nmechanism => 'CRAM-MD5 PLAIN ANONYMOUS',\ncallback => {\npass => \\&fetchpassword,\nuser => $user,\n}\n);\n\n## DESCRIPTION\n\nSASL is a generic mechanism for authentication used by several network protocols. Authen::SASL\nprovides an implementation framework that all protocols should be able to share.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **The Connection Class** (1 subsections)\n- **SEE ALSO**\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Authen::SASL",
        "section": "",
        "mode": "perldoc",
        "summary": "Authen::SASL - SASL Authentication framework",
        "synopsis": "use Authen::SASL;\n$sasl = Authen::SASL->new(\nmechanism => 'CRAM-MD5 PLAIN ANONYMOUS',\ncallback => {\npass => \\&fetchpassword,\nuser => $user,\n}\n);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 74,
                "subsections": []
            },
            {
                "name": "The Connection Class",
                "lines": 43,
                "subsections": [
                    {
                        "name": "Callbacks",
                        "lines": 16
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Authen::SASL - SASL Authentication framework\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Authen::SASL;\n\n$sasl = Authen::SASL->new(\nmechanism => 'CRAM-MD5 PLAIN ANONYMOUS',\ncallback => {\npass => \\&fetchpassword,\nuser => $user,\n}\n);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "SASL is a generic mechanism for authentication used by several network protocols. Authen::SASL\nprovides an implementation framework that all protocols should be able to share.\n\nThe framework allows different implementations of the connection class to be plugged in. At the\ntime of writing there were two such plugins.\n\nAuthen::SASL::Perl\nThis module implements several mechanisms and is implemented entirely in Perl.\n\nAuthen::SASL::XS\nThis module uses the Cyrus SASL C-library (both version 1 and 2 are supported).\n\nAuthen::SASL::Cyrus\nThis module is the predecessor to Authen::SASL::XS. It is reccomended to use\nAuthen::SASL::XS\n\nBy default the order in which these plugins are selected is Authen::SASL::XS,\nAuthen::SASL::Cyrus and then Authen::SASL::Perl.\n\nIf you want to change it or want to specifically use one implementation only simply do\n\nuse Authen::SASL qw(Perl);\n\nor if you have another plugin module that supports the Authen::SASL API\n\nuse Authen::SASL qw(My::SASL::Plugin);\n\nCONTRUCTOR\nnew ( OPTIONS )\nThe constructor may be called with or without arguments. Passing arguments is just a short\ncut to calling the \"mechanism\" and \"callback\" methods.\n\ncallback => { NAME => VALUE, NAME => VALUE, ... }\nSet the callbacks. See the callback method for details.\n\nmechanism => NAMES\nmech => NAMES\nSet the list of mechanisms to choose from. See the mechanism method for details.\n\ndebug => VALUE\nSet the debug level bit-value to \"VALUE\"\n\nDebug output will be sent to \"STDERR\". The bits of this value are:\n\n1   Show debug messages in the Perl modules for the mechanisms.\n(Currently only used in GSSAPI)\n4   With security layers in place show information on packages read.\n8   With security layers in place show information on packages written.\n\nThe default value is 0.\n\nMETHODS\nmechanism ( )\nReturns the current list of mechanisms\n\nmechanism ( NAMES )\nSet the list of mechanisms to choose from. \"NAMES\" should be a space separated string of the\nnames.\n\ncallback ( NAME )\nReturns the current callback associated with \"NAME\".\n\ncallback ( NAME => VALUE, NAME => VALUE, ... )\nSets the given callbacks to the given values\n\nclientnew ( SERVICE, HOST, SECURITY )\nCreates and returns a new connection object for a client-side connection.\n\nservernew ( SERVICE, HOST, OPTIONS )\nCreates and returns a new connection object for a server-side connection.\n\nerror ( )\nReturns any error from the last connection\n",
                "subsections": []
            },
            "The Connection Class": {
                "content": "serverstart ( CHALLENGE )\nserverstart begins the authentication using the chosen mechanism. If the mechanism is not\nsupported by the installed SASL it fails. Because for some mechanisms the client has to\nstart the negotiation, you can give the client challenge as a parameter.\n\nserverstep ( CHALLENGE )\nserverstep performs the next step in the negotiation process. The first parameter you give\nis the clients challenge/response.\n\nclientstart ( )\nThe initial step to be performed. Returns the initial value to pass to the server or an\nempty list on error.\n\nclientstep ( CHALLENGE )\nThis method is called when a response from the server requires it. CHALLENGE is the value\nfrom the server. Returns the next value to pass to the server or an empty list on error.\n\nneedstep ( )\nReturns true if the selected mechanism requires another step before completion (error or\nsuccess).\n\nanswer ( NAME )\nThe method will return the value returned from the last call to the callback NAME\n\nproperty ( NAME )\nReturns the property value associated with \"NAME\".\n\nproperty ( NAME => VALUE, NAME => VALUE, ... )\nSets the named properties to their associated values.\n\nservice ( )\nReturns the service argument that was passed to *new-methods.\n\nhost ( )\nReturns the host argument that was passed to *new-methods.\n\nmechanism ( )\nReturns the name of the chosen mechanism.\n\nissuccess ( )\nOnce needstep() returns false, then you can check if the authentication succeeded by\ncalling this method which returns a boolean value.\n",
                "subsections": [
                    {
                        "name": "Callbacks",
                        "content": "There are three different ways in which a callback may be passed\n\nCODEREF\nIf the value passed is a code reference then, when needed, it will be called and the\nconnection object will be passed as the first argument. In addition some callbacks may be\npassed additional arguments.\n\nARRAYREF\nIf the value passed is an array reference, the first element in the array must be a code\nreference. When the callback is called the code reference will be called with the connection\nobject passed as the first argument and all other values from the array passed after.\n\nSCALAR\nAll other values passed will be used directly. ie it is the same as passing an code\nreference that, when called, returns the value.\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "Authen::SASL::Perl, Authen::SASL::XS, Authen::SASL::Cyrus\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Graham Barr <gbarr@pobox.com>\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) 1998-2005 Graham Barr. All rights reserved. This program is free software; you can\nredistribute it and/or modify it under the same terms as Perl itself.\n",
                "subsections": []
            }
        }
    }
}