Visit Mozilla.org

nsIAuthPrompt

From MDC


The nsIAuthPrompt interface allows the networking layer to pose a user/password prompt to obtain the values needed for authentication.

Contents

nsIAuthPrompt is defined in netwerk/base/public/nsIAuthPrompt.idl. It is scriptable and is currently under review.

Inherits from: nsISupports

[edit] Method overview

boolean prompt(in wstring dialogTitle, in wstring text, in wstring passwordRealm, in PRUint32 savePassword, in wstring defaultText, out wstring result);
boolean promptUsernameAndPassword(in wstring dialogTitle, in wstring text, in wstring passwordRealm, in PRUint32 savePassword, out wstring user, out wstring pwd);
boolean promptPassword(in wstring dialogTitle, in wstring text, in wstring passwordRealm, in PRUint32 savePassword, out wstring pwd);

[edit] Constants

Constant Value Description
SAVE_PASSWORD_NEVER 0 Never saves the password.
SAVE_PASSWORD_FOR_SESSION 1 Saves the password for the session.
SAVE_PASSWORD_PERMANENTLY 2 Saves the password permanently.

[edit] Methods

[edit] prompt()

This method puts up a text input dialog with OK and Cancel buttons.

 boolean prompt(
   in wstring dialogTitle,
   in wstring text,
   in wstring passwordRealm,
   in PRUint32 savePassword,
   in wstring defaultText, 
   out wstring result
 );
[edit] Parameters
dialogTitle
The title of the dialog.
text
The text of the prompt message dialog box.
passwordRealm
The password realm.
savePassword
Saving password option.
defaultText
The default text for the dialog box.
result
The result of the dialog box, OK or Cancel buttons.
[edit] Return Value

Returns true for OK and false for Cancel buttons.

[edit] promptUsernameAndPassword()

This method puts up a username/password dialog with OK and Cancel buttons.

 boolean promptUsernameAndPassword(
   in wstring dialogTitle,
   in wstring text,
   in wstring passwordRealm,
   in PRUint32 savePassword,
   out wstring user, 
   out wstring pwd
 );
[edit] Parameters
dialogTitle
The title of the dialog.
text
The text of the prompt message dialog box.
passwordRealm
The password realm.
savePassword
Saving password option.
user
The user's username.
pwd
The user's password.
[edit] Return Value

Returns true for OK and false for Cancel buttons.

[edit] promptPassword()

This method puts up a password dialog with OK and Cancel buttons.

 boolean promptPassword(
   in wstring dialogTitle,
   in wstring text,
   in wstring passwordRealm,
   in PRUint32 savePassword, 
   out wstring pwd
 );
[edit] Parameters
dialogTitle
The title of the dialog.
text
The text of the prompt message dialog box.
passwordRealm
The password realm.
savePassword
Saving password option.
pwd
The user's password.
[edit] Return Value

Returns true for OK and false for Cancel buttons.