AuthDomainDigest.encodePassword

Encodes the username/realm/password triplet for Digest authentication. (That is, it returns a stringified MD5 hash of @username, @realm, and @password concatenated together). This is the form that is needed as the return value of #SoupAuthDomainDigest's auth handler.

For security reasons, you should store the encoded hash, rather than storing the cleartext password itself and calling this method only when you need to verify it. This way, if your server is compromised, the attackers will not gain access to cleartext passwords which might also be usable at other sites. (Note also that the encoded password returned by this method is identical to the encoded password stored in an Apache .htdigest file.)

class AuthDomainDigest
static
string
encodePassword
(
string username
,
string realm
,
string password
)

Parameters

username string

a username

realm string

an auth realm name

password string

the password for @username in @realm

Return Value

Type: string

the encoded password

Meta