Fixed issue #5. The challenge is only returned when the upper layer returns an unauthorized response