NAME

Amon2::Auth::Site::Hatena - Hatena authentication integration for Amon2

SYNOPSIS

# config
+{
    Auth => {
        Hatena => {
            consumer_key    => 'your consumer key',
            consumer_secret => 'your consumer secret',
        }
    }
}

# app
__PACKAGE__->load_plugin('Web::Auth', {
    module   => 'Hatena',
    on_error => sub {
        my ($c, $error_message) = @_;
        ...
    },
    on_finished => sub {
        my ($c, $token, $token_secret, $user) = @_;

        my $name  = $user->{url_name};     #=> eg. antipop (id)
        my $nick  = $user->{display_name}; #=> eg. kentaro (nick)
        my $image = $user->{profile_image_url};

        $c->session->set(hatena => {
            user         => $user,
            token        => $token,
            token_secret => $token_secret,
        });

        $c->redirect('/');
    },
});

DESCRIPTION

This is a Hatena authentication module for Amon2. You can easily let users authenticate via Hatena OAuth API using this module.

ATTRIBUTES

METHODS

SEE ALSO

AUTHOR

Kentaro Kuribayashi kentarok@gmail.com

LICENSE

Copyright (C) Kentaro Kuribayashi

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.