MATSUNO★Tokuhiro > Amon2-Auth-0.03 > Amon2::Auth::Site::Twitter

Download:
Amon2-Auth-0.03.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source   Latest Release: Amon2-Auth-0.04

NAME ^

Amon2::Auth::Site::Twitter - Twitter integration for Amon2

SYNOPSIS ^

    __PACKAGE__->load_plugin('Web::Auth', {
        module => 'Twitter',
        on_finished => sub {
            my ($c, $access_token, $access_token_secret, $user_id, $screen_name)
                    = @_;
            $c->session->set('name' => $screen_name);
            $c->session->set('site' => 'twitter');
            return $c->redirect('/');
        }
    });

DESCRIPTION ^

This is a twitter authentication module for Amon2. You can call a twitter APIs with this module.

ATTRIBUTES ^

consumer_key
consumer_secret

METHODS ^

$auth->auth_uri($c:Amon2::Web, $callback_uri : Str) :Str

Get a authenticate URI.

$auth->callback($c:Amon2::Web, $callback:HashRef) : Plack::Response

Process the authentication callback dispatching.

$callback MUST have two keys.

on_error

on_error callback function is called if an error was occurred.

The arguments are following:

    sub {
        my ($c, $error_message) = @_;
        ...
    }
on_finished

on_finished callback function is called if an authentication was finished.

The arguments are following:

    sub {
        my ($c, $access_token, $access_token_secret, $user_id, $screen_name)
                = @_;
        ...
    }
syntax highlighting: