Interface nsIHttpAuthenticatorType

nsIHttpAuthenticator

Interface designed to allow for pluggable HTTP authentication modules. Implementations are registered under the ContractID:

"@mozilla.org/network/http-authenticator;1?scheme="

where is the lower-cased value of the authentication scheme found in the server challenge per the rules of RFC 2617.

Hierarchy

Properties

authFlags: number

Flags defining various properties of the authenticator.

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

  • Upon receipt of a server challenge, this function is called to determine whether or not the current user identity has been rejected. If true, then the user will be prompted by the channel to enter (or revise) their identity. Following this, generateCredentials will be called.

    If the IDENTITY_IGNORED auth flag is set, then the aInvalidateIdentity return value will be ignored, and user prompting will be suppressed.

    Parameters

    • aChannel: nsIHttpAuthenticableChannel

      the http channel that received the challenge.

    • aChallenge: string

      the challenge from the WWW-Authenticate/Proxy-Authenticate server response header. (possibly from the auth cache.)

    • aProxyAuth: boolean

      flag indicating whether or not aChallenge is from a proxy.

    • aSessionState: nsISupports

      see description below for generateCredentials.

    • aContinuationState: nsISupports

      see description below for generateCredentials.

    • aInvalidatesIdentity: boolean

    Returns void

  • Called to generate the authentication credentials for a particular server/proxy challenge. This is the value that will be sent back to the server via an Authorization/Proxy-Authorization header.

    This function may be called using a cached challenge provided the authenticator sets the REUSABLE_CHALLENGE flag.

    Parameters

    • aChannel: nsIHttpAuthenticableChannel

      the http channel requesting credentials

    • aChallenge: string

      the challenge from the WWW-Authenticate/Proxy-Authenticate server response header. (possibly from the auth cache.)

    • aProxyAuth: boolean

      flag indicating whether or not aChallenge is from a proxy.

    • aDomain: string

      string containing the domain name (if appropriate)

    • aUser: string

      string containing the user name

    • aPassword: string

      string containing the password

    • aSessionState: nsISupports

      state stored along side the user's identity in the auth cache for the lifetime of the browser session. if a new auth cache entry is created for this challenge, then this parameter will be null. on return, the result will be stored in the new auth cache entry. this parameter is non-null when an auth cache entry is being reused.

    • aContinuationState: nsISupports

      state held by the channel between consecutive calls to generateCredentials, assuming multiple calls are required to authenticate. this state is held for at most the lifetime of the channel.

    • aFlags: number

      authenticator may return one of the generate flags bellow.

    Returns string

  • Called to generate the authentication credentials for a particular server/proxy challenge asynchronously. Credentials will be sent back to the server via an Authorization/Proxy-Authorization header.

    Pram

    aCancel returns cancellable runnable object which caller can use to cancel calling aCallback when finished.

    Parameters

    • aChannel: nsIHttpAuthenticableChannel

      the http channel requesting credentials

    • aCallback: nsIHttpAuthenticatorCallback

      callback function to be called when credentials are available

    • aChallenge: string

      the challenge from the WWW-Authenticate/Proxy-Authenticate server response header. (possibly from the auth cache.)

    • aProxyAuth: boolean

      flag indicating whether or not aChallenge is from a proxy.

    • aDomain: string

      string containing the domain name (if appropriate)

    • aUser: string

      string containing the user name

    • aPassword: string

      string containing the password

    • aSessionState: nsISupports

      state stored along side the user's identity in the auth cache for the lifetime of the browser session. if a new auth cache entry is created for this challenge, then this parameter will be null. on return, the result will be stored in the new auth cache entry. this parameter is non-null when an auth cache entry is being reused. currently modification of session state is not communicated to caller, thus caching credentials obtained by asynchronous way is not supported.

    • aContinuationState: nsISupports

      state held by the channel between consecutive calls to generateCredentials, assuming multiple calls are required to authenticate. this state is held for at most the lifetime of the channel.

    • aCancel: nsICancelable

    Returns void

Generated using TypeDoc