nsIHttpAuthManager

IID:81328d02-74df-4724-8a53-8fac43841c5c
Inherits From:nsISupports

This interface is implemented by the following components:


Methods

void clearAll ( ) void getAuthIdentity ( ACString host , PRInt32 port , ACString realm , ACString path , out AString userDomain , out AString userName , out AString userPassword ) void setAuthIdentity ( ACString host , PRInt32 port , ACString realm , ACString path , AString userDomain , AString userName , AString userPassword )

void clearAll ( )

Clear all auth cache.


void getAuthIdentity ( ACString host , PRInt32 port , ACString realm , ACString path , out AString userDomain , out AString userName , out AString userPassword )

Lookup auth identity.

Arguments:
host
port
realm: optional string identifying auth realm.
path: optional string identifying auth path. empty for proxy auth.
userDomain: return value containing user domain.
userName: return value containing user name.
userPassword: return value containing user password.

void setAuthIdentity ( ACString host , PRInt32 port , ACString realm , ACString path , AString userDomain , AString userName , AString userPassword )

Store auth identity.

Arguments:
host
port
realm: optional string identifying auth realm.
path: optional string identifying auth path. empty for proxy auth.
userDomain: optional string containing user domain.
userName: optional string containing user name.
userPassword: optional string containing user password.

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
September 23, 2005, 9:05 pm stan at getoutfoxed dot com
The parameters listed for setAuthIdentity() and getAuthIdentity() are not correct. (At least for Firefox 1.0.2) A quick dig in the source code (nsHttpAuthManager.cpp) reveals the true parameter set:
nsHttpAuthManager::SetAuthIdentity(
const nsACString & aScheme,
const nsACString & aHost,
PRInt32 aPort,
const nsACString & aAuthType,
const nsACString & aRealm,
const nsACString & aPath,
const nsAString & aUserDomain,
const nsAString & aUserName,
const nsAString & aUserPassword)

and
nsHttpAuthManager::GetAuthIdentity(
const nsACString & aScheme,
const nsACString & aHost,
PRInt32 aPort,
const nsACString & aAuthType,
const nsACString & aRealm,
const nsACString & aPath,
nsAString & aUserDomain,
nsAString & aUserName,
nsAString & aUserPassword)

Even with a correct number of parameters, getAuthIdentity() always returns an unknown error for me, but I was able to get setAuthIdentity() to work.

Copyright © 1999 - 2005 XULPlanet.com