### Class

# Soup Auth

since: 3.0

#### Description [src]

    abstract class Soup.Auth : GObject.Object
    {
      /* No available fields */
    }

The abstract base class for handling authentication.

Specific HTTP Authentication mechanisms are implemented by its subclasses, but applications never need to be aware of the specific subclasses being used.

`SoupAuth` objects store the authentication data associated with a given bit of web space. They are created automatically by `SoupSession`.

Available since: 3.0

#### Ancestors

- GObject

#### Descendants

- SoupAuthBasic
- SoupAuthDigest
- SoupAuthNTLM
- SoupAuthNegotiate

#### Constructors

###### soup_auth_new

Creates a new `SoupAuth` of type `type` with the information from `msg` and `auth_header`.

since: 3.0

#### Instance methods

###### soup_auth_authenticate

Call this on an auth to authenticate it.

since: 3.0

###### soup_auth_can_authenticate

Tests if `auth` is able to authenticate by providing credentials to the `soup_auth_authenticate()`.

since: 3.0

###### soup_auth_cancel

Call this on an auth to cancel it.

since: 3.0

###### soup_auth_free_protection_space

Frees `space`.

since: 3.0

###### soup_auth_get_authority

Returns the authority (host:port) that `auth` is associated with.

since: 3.0

###### soup_auth_get_authorization

Generates an appropriate “Authorization” header for `msg`.

since: 3.0

###### soup_auth_get_info

Gets an opaque identifier for `auth`.

since: 3.0

###### soup_auth_get_protection_space

Returns a list of paths on the server which `auth` extends over.

since: 3.0

###### soup_auth_get_realm

Returns `auth`‘s realm.

since: 3.0

###### soup_auth_get_scheme_name

Returns `auth`‘s scheme name. (Eg, “Basic”, “Digest”, or “NTLM”)

since: 3.0

###### soup_auth_is_authenticated

Tests if `auth` has been given a username and password.

since: 3.0

###### soup_auth_is_cancelled

Tests if `auth` has been cancelled.

since: 3.0

###### soup_auth_is_for_proxy

Tests whether or not `auth` is associated with a proxy server rather than an “origin” server.

since: 3.0

###### soup_auth_is_ready

Tests if `auth` is ready to make a request for `msg` with.

since: 3.0

###### soup_auth_update

Updates `auth` with the information from `msg` and `auth_header`, possibly un-authenticating it.

since: 3.0

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Soup.Auth:authority

The authority (host:port) being authenticated to.

since: 3.0

###### Soup.Auth:is-authenticated

Whether or not the auth has been authenticated.

since: 3.0

###### Soup.Auth:is-cancelled

Whether or not the auth has been cancelled.

since: 3.0

###### Soup.Auth:is-for-proxy

Whether or not the auth is for a proxy server.

since: 3.0

###### Soup.Auth:realm

The authentication realm.

since: 3.0

###### Soup.Auth:scheme-name

The authentication scheme name.

since: 3.0

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

since: 2.0

#### Class structure

    struct SoupAuthClass {
      GObjectClass parent_class;
      const char* scheme_name;
      guint strength;
      gboolean (* update) (
        SoupAuth* auth,
        SoupMessage* msg,
        GHashTable* auth_header
      );
      GSList* (* get_protection_space) (
        SoupAuth* auth,
        GUri* source_uri
      );
      void (* authenticate) (
        SoupAuth* auth,
        const char* username,
        const char* password
      );
      gboolean (* is_authenticated) (
        SoupAuth* auth
      );
      char* (* get_authorization) (
        SoupAuth* auth,
        SoupMessage* msg
      );
      gboolean (* is_ready) (
        SoupAuth* auth,
        SoupMessage* msg
      );
      gboolean (* can_authenticate) (
        SoupAuth* auth
      );
      None padding;

    }

No description available.

###### Class members

`parent_class: GObjectClass`
  No description available.
`scheme_name: const char*`
  No description available.
`strength: guint`
  No description available.
`update: gboolean (* update) ( SoupAuth* auth, SoupMessage* msg, GHashTable* auth_header )`
  No description available.
`get_protection_space: GSList* (* get_protection_space) ( SoupAuth* auth, GUri* source_uri )`
  No description available.
`authenticate: void (* authenticate) ( SoupAuth* auth, const char* username, const char* password )`
  No description available.
`is_authenticated: gboolean (* is_authenticated) ( SoupAuth* auth )`
  No description available.
`get_authorization: char* (* get_authorization) ( SoupAuth* auth, SoupMessage* msg )`
  No description available.
`is_ready: gboolean (* is_ready) ( SoupAuth* auth, SoupMessage* msg )`
  No description available.
`can_authenticate: gboolean (* can_authenticate) ( SoupAuth* auth )`
  No description available.
`padding: None`
  No description available.

#### Virtual methods

###### Soup.AuthClass.authenticate

Call this on an auth to authenticate it.

since: 3.0

###### Soup.AuthClass.can_authenticate

Tests if `auth` is able to authenticate by providing credentials to the `soup_auth_authenticate()`.

since: 3.0

###### Soup.AuthClass.get_authorization

Generates an appropriate “Authorization” header for `msg`.

since: 3.0

###### Soup.AuthClass.get_protection_space

Returns a list of paths on the server which `auth` extends over.

since: 3.0

###### Soup.AuthClass.is_authenticated

Tests if `auth` has been given a username and password.

since: 3.0

###### Soup.AuthClass.is_ready

Tests if `auth` is ready to make a request for `msg` with.

since: 3.0

###### Soup.AuthClass.update

Updates `auth` with the information from `msg` and `auth_header`, possibly un-authenticating it.

since: 3.0