Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
nsHttpAuthManager Class Reference

#include <nsHttpAuthManager.h>

Inheritance diagram for nsHttpAuthManager:
Inheritance graph
[legend]
Collaboration diagram for nsHttpAuthManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIHTTPAUTHMANAGER 
nsHttpAuthManager ()
virtual ~nsHttpAuthManager ()
nsresult Init ()
void getAuthIdentity (in ACString aScheme, in ACString aHost, in PRInt32 aPort, in ACString aAuthType, in ACString aRealm, in ACString aPath, out AString aUserDomain, out AString aUserName, out AString aUserPassword)
 Lookup auth identity.
void setAuthIdentity (in ACString aScheme, in ACString aHost, in PRInt32 aPort, in ACString aAuthType, in ACString aRealm, in ACString aPath, in AString aUserDomain, in AString aUserName, in AString aUserPassword)
 Store auth identity.
void clearAll ()
 Clear all auth cache.

Protected Attributes

nsHttpAuthCachemAuthCache

Detailed Description

Definition at line 44 of file nsHttpAuthManager.h.


Constructor & Destructor Documentation

Definition at line 46 of file nsHttpAuthManager.cpp.

{
}

Definition at line 75 of file nsHttpAuthManager.cpp.

{
}

Member Function Documentation

Clear all auth cache.

void nsIHttpAuthManager::getAuthIdentity ( in ACString  aScheme,
in ACString  aHost,
in PRInt32  aPort,
in ACString  aAuthType,
in ACString  aRealm,
in ACString  aPath,
out AString  aUserDomain,
out AString  aUserName,
out AString  aUserPassword 
) [inherited]

Lookup auth identity.

Parameters:
aSchemethe URL scheme (e.g., "http"). NOTE: for proxy authentication, this should be "http" (this includes authentication for SSL tunneling).
aHostthe host of the server issuing a challenge (ASCII only).
aPortthe port of the server issuing a challenge.
aAuthTypeoptional string identifying auth type used (e.g., "basic")
aRealmoptional string identifying auth realm.
aPathoptional string identifying auth path. empty for proxy auth.
aUserDomainreturn value containing user domain.
aUserNamereturn value containing user name.
aUserPasswordreturn value containing user password.

Definition at line 50 of file nsHttpAuthManager.cpp.

{
  // get reference to the auth cache.  we assume that we will live
  // as long as gHttpHandler.  instantiate it if necessary.

  if (!gHttpHandler) {
    nsresult rv;
    nsCOMPtr<nsIIOService> ios = do_GetIOService(&rv);
    if (NS_FAILED(rv))
      return rv;

    nsCOMPtr<nsIProtocolHandler> handler;
    rv = ios->GetProtocolHandler("http", getter_AddRefs(handler));
    if (NS_FAILED(rv))
      return rv;

    // maybe someone is overriding our HTTP handler implementation?
    NS_ENSURE_TRUE(gHttpHandler, NS_ERROR_UNEXPECTED);
  }
       
  mAuthCache = gHttpHandler->AuthCache();
  NS_ENSURE_TRUE(mAuthCache, NS_ERROR_FAILURE);
  return NS_OK;
}

Here is the call graph for this function:

void nsIHttpAuthManager::setAuthIdentity ( in ACString  aScheme,
in ACString  aHost,
in PRInt32  aPort,
in ACString  aAuthType,
in ACString  aRealm,
in ACString  aPath,
in AString  aUserDomain,
in AString  aUserName,
in AString  aUserPassword 
) [inherited]

Store auth identity.

Parameters:
aSchemethe URL scheme (e.g., "http"). NOTE: for proxy authentication, this should be "http" (this includes authentication for SSL tunneling).
aHostthe host of the server issuing a challenge (ASCII only).
aPortthe port of the server issuing a challenge.
aAuthTypeoptional string identifying auth type used (e.g., "basic")
aRealmoptional string identifying auth realm.
aPathoptional string identifying auth path. empty for proxy auth.
aUserDomainoptional string containing user domain.
aUserNameoptional string containing user name.
aUserPasswordoptional string containing user password.

Member Data Documentation

Definition at line 55 of file nsHttpAuthManager.h.


The documentation for this class was generated from the following files: