1
저는 SharePoint 개발자가 Subversion과 함께 작동하도록 Perl 모듈을 얻으려고 노력하고 있지만 내 구문에 문제가 있다고 생각합니다. 난 그냥 사용자 이름과 비밀 번호를 얻고, webservice에 전달하고, true/false를 얻고 그 정보를 기반으로 인증해야합니다. 다음은 Perl 모듈의 코드입니다.Apache 2 및 Perl의 인증 모듈 문제
package Apache2::AuthGetUser; #authenticates users based on bool value from a asmx webservice
use SOAP::Lite;
use Data::Dumper;
use strict;
use warnings;
use Apache2::Access();
use Apache2::RequestRec();
use Apache2::Const ':common';
sub handler {
my $r = shift;
my $username = $r->user;
my ($status, $password) = $r->get_basic_auth_pw;
return $status unless $status == Apache2::Const::OK;
my $endpoint = "http://localhost:2010/CIM.FBAAuthentication/12/template/layouts/wsFBAAuthentication.asmx"; #endpoint
my $namespace = "http://tempuri.org/"; #namespace
my $wsfunction = "AuthenticateUser"; #webservice function
my $webservice = SOAP::Lite
->uri($namespace)
->on_action(sub { join '/', $namespace, $_[1] })
->proxy($endpoint);
#my $method = SOAP::Data->name($wsfunction)
my $method = SOAP::Data->name($wsfunction)
->attr({xmlns => $namespace});
my @params = (SOAP::Data->name('UserName')->value($username)->type(''), SOAP::Data->name('Password')->value($password)->type(''));
my $result = $webservice->call($method=>@params)->result;
if($result ne "true"){
$r->note_basic_auth_failure;
#$r->log_reason($result);
return AUTH_REQUIRED;
}
return Apache2::Const::OK;
}
1;
누군가에게 의견이 있으면 알려주십시오. Apache 구성 파일에 다음과 같은 오류가 발생합니다. C : /usr/site/lib/Apache2/AuthGetUser.pm 행의 정의되지 않은 값에서 메서드 "value"를 호출 할 수 없습니다. 이 기능이 작동하게되면 곧 블로그 게시물을 갖게 될 것입니다.
사용자 영역을 차지하는 상위 영역에있을 수있는 문제가 있습니다. $ r-> user ('user')로 던져 봤지만 도움이되지는 않을 것입니다 ... 깨는 일 아웃을 추가하고 유형을 추가하는 것은 아마도 아직 너무 많이 진행되지 않았을 것입니다. – MOSSLover