Fix for #JENKINS-25144
return authentication object instead of null if authentication is not required - otherwise valid login fails with basic authentication