This method will set the Authorization request header for the client session
using the credentials provided by the caller. It will always override any
custom Authorization header value which may have been previously set using the
SetHeader method.
If both the UserName and Password
parameters specify empty strings, the current authentication type will always be
set to httpAuthNone regardless of the value of
the AuthType parameter. This effectively clears the current
user credentials for the client session.
If you provide a user name and password to the Connect
method, or you set the UserName property and either the
Password or BearerToken property prior
to calling the Connect method, authentication will be
automatically attempted at the time the connection is made. This method
is only required if you do not provide user credentials when the connection
is established and wish to authenticate the client session at a later time.