Daisuke Murase > Catalyst-Plugin-Authentication-Credential-Hatena > Catalyst::Plugin::Authentication::Credential::Hatena

Download:
Catalyst-Plugin-Authentication-Credential-Hatena-0.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  

NAME ^

Catalyst::Plugin::Authentication::Credential::Hatena - Hatena authentication for Catalyst

SYNOPSIS ^

    # load plugin and setup
    use Catalyst qw(
        Authentication
        Authentication::Credential::Hatena
        
        Session
        Session::Store::FastMmap
        Session::State::Cookie
    );
    
    __PACKAGE__->config->{authentication}->{hatena} = {
        api_key => 'your api_key',
        secret  => 'your shared secret',
    };
    
    
    # in controller
    # redirect login url
    sub login : Path('/hatena/login') {
        my ( $self, $c ) = @_;
    
        $c->res->redirect( $c->authenticate_hatena_url );
    }
    
    # callback url
    sub auth : Path('/hatena/auth') {
        my ( $self, $c ) = @_;
    
        if ( $c->authenticate_hatena ) {
            # login successful
            $c->res->redirect( $c->uri_for('/') );
        }
        else {
            # something wrong
        }
    }

DESCRIPTION ^

This module provide authentication via Hatena, using its api.

SEE ALSO ^

Hatena::API::Auth, http://auth.hatena.ne.jp/

EXTENDED METHODS ^

setup

METHODS ^

authenticate_hatena_url

authenticate_hatena

AUTHOR ^

Daisuke Murase <typester@cpan.org>

COPYRIGHT ^

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

The full text of the license can be found in the LICENSE file included with this module.

syntax highlighting: