win32cred.CredUICmdLinePromptForCredentials

(PyUnicode, PyUnicode, boolean) = CredUICmdLinePromptForCredentials(TargetName, AuthError , UserName , Password , Save , Flags )

Prompt for username/passwd from a console app

Parameters

TargetName : PyUnicode

Server or domain against which to authenticate

AuthError=0 : int

Error code indicating why credentials are required, can be 0

UserName=None : PyUnicode

Default username, can be None. At most CREDUI_MAX_USERNAME_LENGTH chars

Password=None : PyUnicode

Password, can be None. At most CREDUI_MAX_PASSWORD_LENGTH chars

Save=True : boolean

Specifies default value for Save prompt

Flags=CREDUI_FLAGS_EXCLUDE_CERTIFICATES : int

Combination of CREDUI_FLAGS_* values

Comments

The command-line version of this function does not accept certificates, so Flags must contain CREDUI_FLAGS_EXCLUDE_CERTIFICATES or CREDUI_FLAGS_REQUIRE_SMARTCARD

Return Value

Returns the username and password entered, and a boolean indicating if credential was saved