X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FCredential%2FOAuth.pm;h=4e04addebf096ef63f214ef40628b9389d14811c;hb=eefa174216a1a354a5b9b7bcc034d7f711a0e670;hp=ba846e3a542b05b01e469d6e04c14f57bb019922;hpb=a82adf5e08f57a472c159de4eda45e4deda8adf5;p=catagits%2FCatalyst-Authentication-Credential-OAuth.git diff --git a/lib/Catalyst/Authentication/Credential/OAuth.pm b/lib/Catalyst/Authentication/Credential/OAuth.pm index ba846e3..4e04add 100644 --- a/lib/Catalyst/Authentication/Credential/OAuth.pm +++ b/lib/Catalyst/Authentication/Credential/OAuth.pm @@ -41,7 +41,7 @@ sub authenticate { my $provider = $self->providers->{ $auth_info->{provider} }; - for ( qw/ consumer_key consumer_secret request_token_endpoint access_token_endpoint user_auth_endpoint / ) { + for ( qw/ consumer_key consumer_secret request_token_endpoint access_token_endpoint user_auth_endpoint extra_params / ) { Catalyst::Exception->throw( $_ . " is not defined for provider ". $auth_info->{provider} ) unless $provider->{$_}; } @@ -54,7 +54,11 @@ sub authenticate { request_method => 'GET', signature_method => 'HMAC-SHA1', oauth_version => '1.0a', - callback => $c->uri_for( $c->action, $c->req->captures, @{ $c->req->args } )->as_string + callback => $c->uri_for( $c->action, $c->req->captures, @{ $c->req->args } )->as_string, + ( defined $provider->{extra_params} + ? ( extra_params => $provider->{extra_params} ) + : () + ), ); $c->log_debug( "authenticate() called from " . $c->request->uri ) if $self->debug; @@ -65,7 +69,7 @@ sub authenticate { if( $oauth_token ) { - my $response = Net::OAuth->response( 'user auth' )->from_hash( $c->req->params ); + my $response = Net::OAuth->response( 'user auth' )->from_hash( { %{$c->req->params}, %{$provider->{extra_params}} } ); my $request = Net::OAuth->request( 'access token' )->new( %defaults,