{
    "content": [
        {
            "type": "text",
            "text": "# Authen::SCRAM (perldoc)\n\n## NAME\n\nAuthen::SCRAM - Salted Challenge Response Authentication Mechanism (RFC 5802)\n\n## SYNOPSIS\n\nuse Authen::SCRAM::Client;\nuse Authen::SCRAM::Server;\nuse Try::Tiny;\n### CLIENT SIDE ###\n$client = Authen::SCRAM::Client->new(\nusername => 'johndoe',\npassword => 'trustno1',\n);\ntry {\n$clientfirst = $client->firstmsg();\n# send to server and get server-first-message\n$clientfinal = $client->finalmsg( $serverfirst );\n# send to server and get server-final-message\n$client->validate( $serverfinal );\n}\ncatch {\ndie \"Authentication failed!\"\n};\n### SERVER SIDE ###\n$server = Authen::SCRAM::Server->new(\ncredentialcb => \\&getcredentials,\n);\n$username = try {\n# get client-first-message\n$serverfirst = $server->firstmsg( $clientfirst );\n# send to client and get client-final-message\n$serverfinal = $server->finalmsg( $clientfinal );\n# send to client\nreturn $server->authorizationid; # returns valid username\n}\ncatch {\ndie \"Authentication failed!\"\n};\n\n## DESCRIPTION\n\nThe modules in this distribution implement the Salted Challenge Response Authentication\nMechanism (SCRAM) from RFC 5802.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **SUPPORT** (1 subsections)\n- **AUTHOR**\n- **CONTRIBUTOR**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Authen::SCRAM",
        "section": "",
        "mode": "perldoc",
        "summary": "Authen::SCRAM - Salted Challenge Response Authentication Mechanism (RFC 5802)",
        "synopsis": "use Authen::SCRAM::Client;\nuse Authen::SCRAM::Server;\nuse Try::Tiny;\n### CLIENT SIDE ###\n$client = Authen::SCRAM::Client->new(\nusername => 'johndoe',\npassword => 'trustno1',\n);\ntry {\n$clientfirst = $client->firstmsg();\n# send to server and get server-first-message\n$clientfinal = $client->finalmsg( $serverfirst );\n# send to server and get server-final-message\n$client->validate( $serverfinal );\n}\ncatch {\ndie \"Authentication failed!\"\n};\n### SERVER SIDE ###\n$server = Authen::SCRAM::Server->new(\ncredentialcb => \\&getcredentials,\n);\n$username = try {\n# get client-first-message\n$serverfirst = $server->firstmsg( $clientfirst );\n# send to client and get client-final-message\n$serverfinal = $server->finalmsg( $clientfinal );\n# send to client\nreturn $server->authorizationid; # returns valid username\n}\ncatch {\ndie \"Authentication failed!\"\n};",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 49,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SUPPORT",
                "lines": 5,
                "subsections": [
                    {
                        "name": "Source Code",
                        "lines": 7
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CONTRIBUTOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Authen::SCRAM - Salted Challenge Response Authentication Mechanism (RFC 5802)\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 0.011\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Authen::SCRAM::Client;\nuse Authen::SCRAM::Server;\nuse Try::Tiny;\n\n### CLIENT SIDE ###\n\n$client = Authen::SCRAM::Client->new(\nusername => 'johndoe',\npassword => 'trustno1',\n);\n\ntry {\n$clientfirst = $client->firstmsg();\n\n# send to server and get server-first-message\n\n$clientfinal = $client->finalmsg( $serverfirst );\n\n# send to server and get server-final-message\n\n$client->validate( $serverfinal );\n}\ncatch {\ndie \"Authentication failed!\"\n};\n\n### SERVER SIDE ###\n\n$server = Authen::SCRAM::Server->new(\ncredentialcb => \\&getcredentials,\n);\n\n$username = try {\n# get client-first-message\n\n$serverfirst = $server->firstmsg( $clientfirst );\n\n# send to client and get client-final-message\n\n$serverfinal = $server->finalmsg( $clientfinal );\n\n# send to client\n\nreturn $server->authorizationid; # returns valid username\n}\ncatch {\ndie \"Authentication failed!\"\n};\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The modules in this distribution implement the Salted Challenge Response Authentication\nMechanism (SCRAM) from RFC 5802.\n\nSee Authen::SCRAM::Client and Authen::SCRAM::Server for usage details.\n",
                "subsections": []
            },
            "SUPPORT": {
                "content": "Bugs / Feature Requests\nPlease report any bugs or feature requests through the issue tracker at\n<https://github.com/dagolden/Authen-SCRAM/issues>. You will be notified automatically of any\nprogress on your issue.\n",
                "subsections": [
                    {
                        "name": "Source Code",
                        "content": "This is open source software. The code repository is available for public review and\ncontribution under the terms of the license.\n\n<https://github.com/dagolden/Authen-SCRAM>\n\ngit clone https://github.com/dagolden/Authen-SCRAM.git\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "David Golden <dagolden@cpan.org>\n",
                "subsections": []
            },
            "CONTRIBUTOR": {
                "content": "David Golden <xdg@xdg.me>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is Copyright (c) 2014 by David Golden.\n\nThis is free software, licensed under:\n\nThe Apache License, Version 2.0, January 2004\n",
                "subsections": []
            }
        }
    }
}