{
    "mode": "perldoc",
    "parameter": "Net::Twitter::Role::AppAuth",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ATwitter%3A%3ARole%3A%3AAppAuth/json",
    "generated": "2026-10-08T02:56:58Z",
    "synopsis": "use Net::Twitter;\nmy $nt = Net::Twitter->new(\ntraits          => ['API::RESTv11', 'AppAuth'],\nconsumerkey    => \"YOUR-CONSUMER-KEY\",\nconsumersecret => \"YOUR-CONSUMER-SECRET\",\n);\n$nt->requesttoken;\nmy $tweets = $nt->usertimeline({ screenname => 'Twitter' });",
    "sections": {
        "NAME": {
            "content": "Net::Twitter::Role::AppAuth - OAuth2 Application Only Authentication\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 4.01043\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Net::Twitter;\n\nmy $nt = Net::Twitter->new(\ntraits          => ['API::RESTv11', 'AppAuth'],\nconsumerkey    => \"YOUR-CONSUMER-KEY\",\nconsumersecret => \"YOUR-CONSUMER-SECRET\",\n);\n\n$nt->requesttoken;\n\nmy $tweets = $nt->usertimeline({ screenname => 'Twitter' });\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Net::Twitter::Role::OAuth is a Net::Twitter role that provides OAuth authentication instead of\nthe default Basic Authentication.\n\nNote that this client only works with APIs that are compatible to OAuth authentication.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "authorized\nTrue if the client has an accesstoken. This does not check the validity of the access\ntoken, so requests may fail if it is invalid.\n\nrequestaccesstoken\nRequest an access token. Returns the token as well as saving it in the object.\n\naccesstoken\nGet or set the access token.\n\ninvalidatetoken\nInvalidates and clears the accesstoken.\n\nNote: There seems to be a Twitter bug preventing this from working---perhaps a documentation\nbug. E.g., see:\n<https://twittercommunity.com/t/revoke-an-access-token-programmatically-always-getting-a-403\n-forbidden/1902>\n",
            "subsections": []
        }
    },
    "summary": "Net::Twitter::Role::AppAuth - OAuth2 Application Only Authentication",
    "flags": [],
    "examples": [],
    "see_also": []
}