[Issue #89] Fixing authentication challenge handling