Soup.AuthDomainDigest.encode_password
Description: Reference for Soup.AuthDomainDigest.encode_password

### Function

# Soup AuthDomainDigestencode_password

#### Declaration [src]

    char*
    soup_auth_domain_digest_encode_password (
      const char* username,
      const char* realm,
      const char* password
    )

#### Description [src]

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.)

#### Parameters

`username`

  Type: `const char*`

  A username.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`realm`

  Type: `const char*`

  An auth realm name.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`password`

  Type: `const char*`

  The password for `username` in `realm`.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

#### Return value

Type: `char*`

The encoded password.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.