Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Net::Twitter::Role::AppAuth

Name Net::Twitter::Role::AppAuth
Version 4.01043
Located at /usr/share/perl5
File /usr/share/perl5/Net/Twitter/Role/AppAuth.pm
Is Core No
Search CPAN for this module Net::Twitter::Role::AppAuth
Documentation Net::Twitter::Role::AppAuth
Module Details Net::Twitter::Role::AppAuth


NAME

Net::Twitter::Role::AppAuth - OAuth2 Application Only Authentication


VERSION

version 4.01043


SYNOPSIS

  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' });


DESCRIPTION

Net::Twitter::Role::OAuth is a Net::Twitter role that provides OAuth authentication instead of the default Basic Authentication.

Note that this client only works with APIs that are compatible to OAuth authentication.


METHODS

authorized
True if the client has an access_token. This does not check the validity of the access token, so requests may fail if it is invalid.

request_access_token
Request an access token. Returns the token as well as saving it in the object.

access_token
Get or set the access token.

invalidate_token
Invalidates and clears the access_token.

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

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026