- fixed: Basic Auth doesn't work if password contains colon (Arjan Widlak,
United Knowledge) - fixed: Basic Auth causes internal server error if you use more than one colon. (Arjan Widlak, United Knowledge)
This commit is contained in:
parent
4dd1089a00
commit
4ff5595666
2 changed files with 18 additions and 8 deletions
|
|
@ -167,15 +167,21 @@ sub handler {
|
|||
$matchUri =~ s{^$gateway}{/};
|
||||
my $gotMatch = 0;
|
||||
|
||||
# handle basic auth
|
||||
my $auth = $request->headers_in->{'Authorization'};
|
||||
if ($auth =~ m/^Basic/) { # machine oriented
|
||||
$auth =~ s/Basic //;
|
||||
authen($request, split(":",MIME::Base64::decode_base64($auth)), $config);
|
||||
# handle basic auth
|
||||
# Get the type of authorization required for this request (the per
|
||||
# directory configuration directive AuthType):
|
||||
my $auth = $request->auth_type;
|
||||
if ($auth eq "Basic") { # machine oriented
|
||||
# Get username and password from Apache and hand over to authen, Basic
|
||||
# Auth for WebGUI
|
||||
my $basicAuthUser = $request->get_remote_logname;
|
||||
my $basicAuthPass = $request->get_basic_auth_pw;
|
||||
authen($request, $basicAuthUser, $basicAuthPass, $config);
|
||||
}
|
||||
else { # realm oriented
|
||||
$request->push_handlers(PerlAuthenHandler => sub { return WebGUI::authen($request, undef, undef, $config)});
|
||||
}
|
||||
else { # realm oriented
|
||||
$request->push_handlers(PerlAuthenHandler => sub { return WebGUI::authen($request, undef, undef, $config)});
|
||||
}
|
||||
|
||||
|
||||
# url handlers
|
||||
WEBGUI_FATAL: foreach my $handler (@{$config->get("urlHandlers")}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue