diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 6dd7020a4..b2b496bca 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,8 @@ 7.7.8 + - 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) - added date pagination, and some formatting to EMS Schedule table - Removed dubious 3px padding around image based ads in an adspace. - Stats now send over SSL rather than straight HTTP. diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index 975a891ba..d098a42b4 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -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")}) {