Soup.Auth
Description: Reference for Soup.Auth

### Class

# SoupAuth

#### 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`.

#### 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`.

#### Instance methods

###### soup_auth_authenticate

Call this on an auth to authenticate it.

###### soup_auth_can_authenticate

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

###### soup_auth_cancel

Call this on an auth to cancel it.

###### soup_auth_free_protection_space

Frees `space`.

###### soup_auth_get_authority

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

###### soup_auth_get_authorization

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

###### soup_auth_get_info

Gets an opaque identifier for `auth`.

###### soup_auth_get_protection_space

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

###### soup_auth_get_realm

Returns `auth`‘s realm.

###### soup_auth_get_scheme_name

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

###### soup_auth_is_authenticated

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

###### soup_auth_is_cancelled

Tests if `auth` has been cancelled.

###### soup_auth_is_for_proxy

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

###### soup_auth_is_ready

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

###### soup_auth_update

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

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

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

Whether or not the auth has been authenticated.

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

Whether or not the auth has been cancelled.

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

Whether or not the auth is for a proxy server.

###### Soup.Auth:realm

The authentication realm.

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

The authentication scheme name.

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

#### 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
      );
      gpointer 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: gpointer`

  No description available.

#### Virtual methods

###### Soup.AuthClass.authenticate

Call this on an auth to authenticate it.

###### Soup.AuthClass.can_authenticate

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

###### Soup.AuthClass.get_authorization

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

###### Soup.AuthClass.get_protection_space

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

###### Soup.AuthClass.is_authenticated

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

###### Soup.AuthClass.is_ready

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

###### Soup.AuthClass.update

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