Using Windows Authentication


According to MSDN, to use BITS Windows Authentication, I need to pass null for the UserName and Password. If I set either the UserName or Password to null in BitsCredentials an exception is thrown when I call BitsJob.AddCredentials(BitsCredentials credentials). Looking at the source code for the AddCredentials method, the problem is with these lines:
                bgCredentials.Credentials.Basic.Password = credentials.Password.ToString();
                bgCredentials.Credentials.Basic.UserName = credentials.UserName.ToString();
Passing null for Password or UserName obviously won't work.

So, the question is how do I use Windows Authentication?