lib/Middleware/DigestAuthMiddleware.php
private function setAuthenticationMethod(string $authenticationMethod): void
    {
        if ('Digest' === $authenticationMethod || 'Basic' === $authenticationMethod) {
            $this->authenticationMethod = $authenticationMethod;
        } else {
            throw new \InvalidArgumentException('DigestAuthMiddleware: Only Digest and Basic authentication methods are currently supported.');
        }
    }
private function setAuthenticationMethod(string $authenticationMethod): void
    {
        if ('Digest' === $authenticationMethod || 'Basic' === $authenticationMethod) {
            $this->authenticationMethod = $authenticationMethod;
        } else {
            throw new \InvalidArgumentException('DigestAuthMiddleware: Only Digest and Basic authentication methods are currently supported.');
        }
    }
Sets authentication method to be used. Options are "Digest" and "Basic".
If the server and the client are unable to authenticate using Digest then the RFCs state that the server should attempt
to authenticate the client using Basic authentication. This ensures that we adhere to that behaviour.
This does however create the possibilty of a downgrade attack so it may be an idea to add a way of disabling this functionality
as Basic authentication is trivial to decrypt and exposes the username/password to a man-in-the-middle attack.

@param string $authenticationMethod the authentication method requested by the server

@throws \InvalidArgumentException If $authenticationMethod is set to anything other than Digest or Basic