Catalyst-Authentication-Credential-OAuth

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

        <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 {

lib/Catalyst/Authentication/Credential/OAuth.pm  view on Meta::CPAN

}

sub authenticate {
	my ($self, $c, $realm, $auth_info) = @_;

    Catalyst::Exception->throw( "Provider is not defined." )
        unless defined $auth_info->{provider} || defined $self->providers->{ $auth_info->{provider} };

    my $provider = $self->providers->{ $auth_info->{provider} };

    for ( qw/ consumer_key consumer_secret request_token_endpoint access_token_endpoint user_auth_endpoint / ) {
        Catalyst::Exception->throw( $_ . " is not defined for provider ". $auth_info->{provider} )
            unless $provider->{$_};
    }

    my %defaults = (
	consumer_key => $provider->{consumer_key},
	consumer_secret => $provider->{consumer_secret},
        timestamp => time,
        nonce => random_string( 'ccccccccccccccccccc' ),
        request_method => 'GET',

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.372 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )