1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2001-2003, Ximian, Inc.
9 #include <libsoup/soup-types.h>
10 #include <libsoup/soup-headers.h>
14 #define SOUP_TYPE_AUTH (soup_auth_get_type ())
15 #define SOUP_AUTH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_AUTH, SoupAuth))
16 #define SOUP_AUTH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_AUTH, SoupAuthClass))
17 #define SOUP_IS_AUTH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_AUTH))
18 #define SOUP_IS_AUTH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_AUTH))
19 #define SOUP_AUTH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_AUTH, SoupAuthClass))
28 GObjectClass parent_class;
30 const char *scheme_name;
33 gboolean (*update) (SoupAuth *auth,
35 GHashTable *auth_header);
37 GSList * (*get_protection_space) (SoupAuth *auth,
40 void (*authenticate) (SoupAuth *auth,
42 const char *password);
43 gboolean (*is_authenticated) (SoupAuth *auth);
45 char * (*get_authorization) (SoupAuth *auth,
48 gboolean (*is_ready) (SoupAuth *auth,
51 /* Padding for future expansion */
52 void (*_libsoup_reserved2) (void);
53 void (*_libsoup_reserved3) (void);
54 void (*_libsoup_reserved4) (void);
57 #define SOUP_AUTH_SCHEME_NAME "scheme-name"
58 #define SOUP_AUTH_REALM "realm"
59 #define SOUP_AUTH_HOST "host"
60 #define SOUP_AUTH_IS_FOR_PROXY "is-for-proxy"
61 #define SOUP_AUTH_IS_AUTHENTICATED "is-authenticated"
63 GType soup_auth_get_type (void);
65 SoupAuth *soup_auth_new (GType type,
67 const char *auth_header);
68 gboolean soup_auth_update (SoupAuth *auth,
70 const char *auth_header);
72 gboolean soup_auth_is_for_proxy (SoupAuth *auth);
73 const char *soup_auth_get_scheme_name (SoupAuth *auth);
74 const char *soup_auth_get_host (SoupAuth *auth);
75 const char *soup_auth_get_realm (SoupAuth *auth);
76 char *soup_auth_get_info (SoupAuth *auth);
78 void soup_auth_authenticate (SoupAuth *auth,
80 const char *password);
81 gboolean soup_auth_is_authenticated (SoupAuth *auth);
82 SOUP_AVAILABLE_IN_2_42
83 gboolean soup_auth_is_ready (SoupAuth *auth,
86 char *soup_auth_get_authorization (SoupAuth *auth,
89 GSList *soup_auth_get_protection_space (SoupAuth *auth,
91 void soup_auth_free_protection_space (SoupAuth *auth,
94 /* The actual auth types, which can be added/removed as features */
96 #define SOUP_TYPE_AUTH_BASIC (soup_auth_basic_get_type ())
97 GType soup_auth_basic_get_type (void);
98 #define SOUP_TYPE_AUTH_DIGEST (soup_auth_digest_get_type ())
99 GType soup_auth_digest_get_type (void);
100 #define SOUP_TYPE_AUTH_NTLM (soup_auth_ntlm_get_type ())
101 GType soup_auth_ntlm_get_type (void);
103 /* Deprecated SoupPasswordManager-related APIs: all are now no-ops */
104 SOUP_AVAILABLE_IN_2_28
105 SOUP_DEPRECATED_IN_2_28
106 GSList *soup_auth_get_saved_users (SoupAuth *auth);
107 SOUP_AVAILABLE_IN_2_28
108 SOUP_DEPRECATED_IN_2_28
109 const char *soup_auth_get_saved_password (SoupAuth *auth,
111 SOUP_AVAILABLE_IN_2_28
112 SOUP_DEPRECATED_IN_2_28
113 void soup_auth_save_password (SoupAuth *auth,
114 const char *username,
115 const char *password);
116 SOUP_AVAILABLE_IN_2_28
117 SOUP_DEPRECATED_IN_2_28
118 void soup_auth_has_saved_password (SoupAuth *auth,
119 const char *username,
120 const char *password);
124 #endif /* SOUP_AUTH_H */