Catalyst::Authentication::Credential::OAuth - OAuth credential for Catalyst::Plugin::Authentication framework.


Catalyst-Authentication-Credential-OAuth documentation  | view source Contained in the Catalyst-Authentication-Credential-OAuth distribution.

Index


NAME

Top

Catalyst::Authentication::Credential::OAuth - OAuth credential for Catalyst::Plugin::Authentication framework.

VERSION

Top

0.02

SYNOPSIS

Top

In MyApp.pm

    use Catalyst qw/
        Authentication
        Session
        Session::Store::FastMmap
        Session::State::Cookie
    /;




In myapp.conf

    <Plugin::Authentication>
        default_realm	oauth
        <realms>
            <oauth>
                <credential>
                    class	OAuth
                    <providers>
                        <example.com>
                            consumer_key             my_app_key
                            consumer_secret          my_app_secret
                            request_token_endpoint   http://example.com/oauth/request_token
                            access_token_endpoint    http://example.com/oauth/access_token
                            user_auth_endpoint       http://example.com/oauth/authorize
                        </example.com>
                    </providers>
                </credential>
            </oauth>
        </realms>
    </Plugin::Authentication>




In controller code,

    sub oauth : Local {
        my ($self, $c) = @_;

        if( $c->authenticate( { provider => 'example.com' } ) ) {
            #do something with $c->user
        }
    }







USER METHODS

Top

$c->user->token
$c->user->token_secret
$c->user->extra_params - whatever other params the provider sends back

AUTHOR

Top

Cosmin Budrica <cosmin@sinapticode.com>

Bogdan Lucaciu <bogdan@sinapticode.com>

With contributions from:

  Tomas Doran E<lt>bobtfish@bobtfish.netE</gt>




BUGS

Top

Only tested with twitter

COPYRIGHT

Top


Catalyst-Authentication-Credential-OAuth documentation  | view source Contained in the Catalyst-Authentication-Credential-OAuth distribution.