Net::T...AppAuth(3pm)

πŸ“¦
version 4.01043 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble

πŸ’– Net::T...AppAuth(3pm) β€” the whole vibe ✨

okay bestie, gather round, because this is the manual page for Net::Twitter::Role::AppAuth and it's literally the OAuth2 Application Only Authentication moment. no cap. πŸ’…


✨ NAME ✨

Net::Twitter::Role::AppAuth β€” OAuth2 Application Only Authentication πŸ¦‹

🌸 VERSION 🌸

version 4.01043 β€” yes that's the actual number, don't come for me πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

here's how you actually use it, copy-paste era:

use Net::Twitter;

my $nt = Net::Twitter->new(
    traits          => ['API::RESTv1_1', 'AppAuth'],
    consumer_key    => "YOUR-CONSUMER-KEY",
    consumer_secret => "YOUR-CONSUMER-SECRET",
);

$nt->request_token;

my $tweets = $nt->user_timeline({ screen_name => 'Twitter' });

like, that's it. that's the whole entrance. 🌈


πŸ’œ DESCRIPTION πŸ’œ

Net::Twitter::Role::OAuth is a Net::Twitter role, and what it does is serve up OAuth authentication instead of the default Basic Authentication. glow-up fr fr ✨

heads up bestie: this client only works with APIs that are compatible to OAuth authentication. so like, vibe check your API first. πŸ’€

πŸ‘‘ METHODS πŸ‘‘

authorized

True if the client has an access_token. 🫢

but lowkey β€” this does not check the validity of the access token, so requests may fail if it is invalid. it's giving "trust but verify" except we're not verifying. 😭

request_access_token

Request an access token. Returns the token and saves it in the object. two things at once, multitasking icon behavior. πŸ’…

access_token

Get or set the access token. simple. iconic. no notes. ⭐

invalidate_token

Invalidates and clears the access_token. bye bestie πŸ‘‹

Note: there seems to be a Twitter bug preventing this from working---perhaps a documentation bug. E.g., see: <https://twittercommunity.com/t/revoke-an-access-token-programmatically-always-getting-a-403-forbidden/1902> so yeah, that's a real link, that's a real bug, and we're just passing the info along fr fr. πŸ™ˆ

and that's the page!! written by the perl docs girlies πŸ’– this was perl v5.34.0, dated 2022-06-16, from the Net::T...AppAuth(3pm) manual β€” mwah, slay, periodt. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from