Pass Username and Password through API

Hi,

in my environment i use the authentication via username and password.
In the API i can pass the nickname but how can i pass the username and the password, so that the dialog does not appear?