Interface nsIOSReauthenticatorType

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • This interface provides an abstract way to request that the user reauthenticate themselves to the operating system. It may be useful in conjunction with nsIOSKeyStore, whereby consumers of these APIs may consider some secrets too sensitive to access without first reauthenticating the user.

    Usage:

    // obtain the singleton nsIOSReauthenticator instance const reauthenticator = Cc["@mozilla.org/security/osreauthenticator;1"] .getService(Ci.nsIOSReauthenticator); if (await reauthenticator.asyncReauthenticate()) { // do something only authenticated users are allowed to do... } else { // show a "sorry, this isn't allowed" error }

    Asynchronously cause the operating system to request that the user reauthenticate. This is typically in the form of a dialog box asking the user for their login password. The actual behaviour of this depends on the OS.

    Returns

    Promise resolving to true if the user successfully authenticated and false otherwise.

    Parameters

    • prompt: string

      A short string that may be incorporated in the dialog

    • caption: string

      A short string that may be shown as the dialog caption (usually Product Name)

    • parentWindow: mozIDOMWindow

      Used to associate the OS dialog with the calling window.

    Returns any

Generated using TypeDoc