Soup.AuthDomainGenericAuthCallback
Description: Reference for Soup.AuthDomainGenericAuthCallback

### Function

# SoupAuthDomainGenericAuthCallback

#### Declaration

    gboolean
    (* SoupAuthDomainGenericAuthCallback) (
      SoupAuthDomain* domain,
      SoupServerMessage* msg,
      const char* username,
      gpointer user_data
    )

#### Description [src]

The prototype for a `SoupAuthDomain` generic authentication callback.

The callback should look up the user’s password, call `soup_auth_domain_check_password()`, and use the return value from that method as its own return value.

In general, for security reasons, it is preferable to use the auth-domain-specific auth callbacks (eg, `SoupAuthDomainBasicAuthCallback` and `SoupAuthDomainDigestAuthCallback`), because they don’t require keeping a cleartext password database. Most users will use the same password for many different sites, meaning if any site with a cleartext password database is compromised, accounts on other servers might be compromised as well. For many of the cases where `SoupServer` is used, this is not really relevant, but it may still be worth considering.

#### Parameters

`domain`

  Type: `SoupAuthDomain`

  A `SoupAuthDomain`.

  The data is owned by the caller of the function.

`msg`

  Type: `SoupServerMessage`

  The `SoupServerMessage` being authenticated.

  The data is owned by the caller of the function.

`username`

  Type: `const char*`

  The username from `msg`.

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

`user_data`

  Type: `gpointer`

  The data passed to `soup_auth_domain_set_generic_auth_callback()`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

#### Return value

Type: `gboolean`

`TRUE` if `msg` is authenticated, `FALSE` if not.