Sets the password for digest user authentication.
WebAPI.bdh
WebSetUserAuthDigest( in sUsername : string allownull, in sPassword : string allownull, in sUrl : string allownull, in sRealm : string allownull ): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
sUsername | User name; this parameter may be NULL. |
sPassword | Password (optional) |
sUrl | URL representing protection space for digest authentication (optional) |
sRealm | Realm for which to set authentication (optional). This realm provides a special context for the username/password to a Web site. For example, www.MyCompany.com uses realm "www.MyCompany.com", whereas www.MyCompany.com/support uses realm "MyCompany support". |
Calling this function inserts the username/password pair into the authentication database used when a server requests digest authentication (code 401). On subsequent requests, the authentication header line is added to the request headers automatically.
To set the default username/password, call WebSetUserAuthDigest("user1", "pass1");
To delete the default username/password, call WebSetUserAuthDigest("", ""); This does not remove the entry from the authentication database.
To remove all cached authentication entries from the cookie database, call WebSetUserAuthDigest(NULL);
In addition, you can add authentication entries directly to the authentication database by providing a protection space and the realm. For example, WebSetUserAuthDigest("DigestcAuthUser", "DigestAuthPass", "http://lab1/testsite/", "lab1");
dcltrans transaction TWeb begin WebSetUserAuthDigest("domain\\user", "password"); WebPageUrl("http://www.mydomain.com/"); end TWeb;