Add failure callback option to authenticate middleware

It is very useful to be able to react more abstract to an authentication failure than just redirecting the user or sending a predefined failure message (setting response header or evaluating the exact reason of failure for example).