Feature 34 authentication failure listener

This feature resolves the "Too many redirections" problem as described in #34