+ $::dispatcher->handle_login_error(error => 'password');
+
+ return 0;
+}
+
+sub _parse_http_basic_auth {
+ my ($self) = @_;
+
+ # See RFC 7617.
+
+ # Requires that the server passes the 'Authorization' header as the
+ # environment variable 'HTTP_AUTHORIZATION'. Example code for
+ # Apache:
+
+ # SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
+
+ my $data = $ENV{HTTP_AUTHORIZATION};
+
+ return unless ($data // '') =~ m{^basic +(.+)}i;
+
+ $data = Encode::decode('utf-8', MIME::Base64::decode($1));
+
+ return unless $data =~ m{(.+?):(.+)};
+
+ return ($1, $2);