WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIAuthPrompt2

IID:447fc780-1d28-412a-91a1-466d48129c65
Inherits From:nsISupports

An interface allowing to prompt for a username and password. This interface is usually acquired using getInterface on notification callbacks or similar. It can be used to prompt users for authentication information, either synchronously or asynchronously.

This interface is implemented by the following components:


Constants

The password will be sent unencrypted. No security provided.
PRUint32 LEVEL_NONE = 0
Password will be sent encrypted, but the connection is otherwise insecure.
PRUint32 LEVEL_PW_ENCRYPTED = 1
The connection, both for password and data, is secure.
PRUint32 LEVEL_SECURE = 2

Methods

nsICancelable asyncPromptAuth ( nsIChannel channel , nsIAuthPromptCallback callback , nsISupports context , PRUint32 level , nsIAuthInformation authInfo ) PRBool promptAuth ( nsIChannel channel , PRUint32 level , nsIAuthInformation authInfo )

nsICancelable asyncPromptAuth ( nsIChannel channel , nsIAuthPromptCallback callback , nsISupports context , PRUint32 level , nsIAuthInformation authInfo )

Asynchronously prompt the user for a username and password. This has largely the same semantics as promptUsernameAndPassword(), but must return immediately after calling and return the entered data in a callback.

If the user closes the dialog using a cancel button or similar, the callback's nsIAuthPromptCallback::onAuthCancelled method must be called. Calling nsICancelable::cancel on the returned object SHOULD close the dialog and MUST call nsIAuthPromptCallback::onAuthCancelled on the provided callback.

Arguments:
channel
callback
context
level
authInfo

PRBool promptAuth ( nsIChannel channel , PRUint32 level , nsIAuthInformation authInfo )

Requests a username and a password. Implementations will commonly show a dialog with a username and password field, depending on flags also a domain field.

Arguments:
channel: The channel that requires authentication.
level: One of the level constants from above. See there for descriptions of the levels.
authInfo: Authentication information object. The implementation should fill in this object with the information entered by the user before returning.

References

This interface is returned from the following methods:

nsIAuthPromptAdapterFactory.createAdapter

Reference documentation is generated from Mozilla's source.