1 .\" <!-- $Id: auth_generic.sgml,v 1.4 2007/07/21 20:05:53 mrsam Exp $ -->
2 .\" <!-- Copyright 2004 Double Precision, Inc. See COPYING for -->
3 .\" <!-- distribution information. -->
4 .\" Title: auth_generic
6 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
8 .\" Manual: Double Precision, Inc.
9 .\" Source: Double Precision, Inc.
11 .TH "AUTH_GENERIC" "3" "08/23/2008" "Double Precision, Inc." "Double Precision, Inc."
12 .\" disable hyphenation
14 .\" disable justification (adjust text to left margin only)
17 auth_generic - Generic authentication request
22 #include <courierauth\.h>
26 .BI "int rc=auth_generic(const\ char\ *" "service" ", const\ char\ *" "authtype" ", const\ char\ *" "authdata" ", int\ " "(*callback_func)" "\ (struct\ authinfo\ *,\ void\ *), void\ *" "callback_arg" ");"
31 processes a generic authentication request\. You do not want to use this function\. You really want to use
32 \fI\fBauth_login\fR(3)\fR\&[1]\.
34 specifies which so\-called "service" is being authenticated; like
39 may or may not be used by the Courier authentication library\'s configured back\-end module\.
43 specifies the format of the authentication request\. Three authentication formats are defined in
50 contains the following string:
51 \(lq\fIuserid\fR\en\fIpassword\fR\en\(rq\. That is, the userid being authenticated, an
53 newline character, the password, and a second newline character\.
56 AUTHTYPE_CRAMMD5 or AUTHTYPE_CRAMSHA1
58 This format is used with
63 contains the following string:
64 \(lq\fIchallenge\fR\en\fIresponse\fR\en\(rq\.
66 is the base64\-encoded challenge, which is followed by an
70 is a base64\-encoded string that\'s followed by a second newline character\. The base64\-encoded string consists of the responding userid, a space character, then the response to the challenge expressed as hexadecimal digits\.
79 \fBcallback_func\fR\'s return value becomes the return value from
81 (which should be 0, by convention)\.
83 will not be invoked if an error occurs, which is reported by a non\-zero return value from
84 \fBauth_generic\fR\. By convention, a positive return value indicates an internal, temporary failure, such as the authentication daemon process not running; a negative return value indicates that this request was processed, but it failed\.
86 The second argument to
89 \fBcallback_arg\fR, which is not interpreted by this function in any way\. The first argument will be a pointer to the following structure:
91 \fBExample\ 1.\ struct authinfo\fR
96 const char *sysusername;
97 const uid_t *sysuserid;
102 const char *fullname;
106 const char *clearpasswd;
114 Description of the above fields:
118 The authenticated login ID\.
123 The authenticated account\'s userid and groupid can be looked up in the password file using
124 address\. If this field is
125 NULL, obtain the userid and the groupid from
139 is initialized, otherwise it\'s a pointer to the account\'s numeric userid\.
144 Account\'s numeric groupid\.
154 This is the account\'s full name\. This field is optional, it may be
160 The account\'s home directory\. This field cannot be
166 The pathname to the account\'s mailbox\. This field is optional, it can be
168 in which case the default location is assumed\.
173 Optional maildir quota on the account\'s mailbox (and
175 if no quota is set)\.
180 The account\'s encrypted password, if available\. If the account has a cleartext password defined, this field can be set to
181 NULL\. The encrypted password can take several formats:
184 \h'-04'\(bu\h'+03'A traditional triple\-DES crypted password, or a MD5+salt\-hashed password, as used in Linux\.
190 followed by a base64\-encoded MD5 hash of the password\.
196 followed by a base64\-encoded SHA1 hash of the password\.
202 The account\'s cleartext password, if available\. If the account has an encrypted password defined, this field can be set to
208 A comma\-separated list of miscellaneous account options\. See below for more information\.
210 .SS "Account options"
212 Depending on the configuration of the Courier authentication library, accounts may have individual options associated with them\. If the authentication library configuration does not implement account options, the option string will be
213 NULL\. Otherwise it will be a comma\-separated list of
214 \(lq\fIoption\fR=\fIvalue\fR\(rq
218 .nr an-no-space-flag 1
223 This is the account option implementation that\'s used by Courier, Courier\-IMAP, and SqWebMail packages\. Some of the following information is obviously not applicable for a particular package\. The inapplicable bits should be obvious\.
225 The following options are recognized by the various Courier packages:
228 .nr an-no-space-flag 1
233 The application is responsible for enforcing all the
235 option\. An authentication request for service
236 \(lqimap\(rq, for example, will succeed provided that the userid and the password are valid, even if
237 \(lqdisableimap=1\(rq
238 is set\. The application\'s
240 should check for this condition, and return a negative return code\.
244 If "n" is 1, IMAP access to this account should be disabled\.
249 If "n" is 1, POP3 access to this account should be disabled\.
252 disablewebmail=\fIn\fR
254 If "n" is 1, webmail access to this account should be disabled\.
257 disableshared=\fIn\fR
259 If "n" is 1, this account should not have access to shared folders or be able to share its own folders with other people\.
264 This account is a member of access group
265 \fIname\fR\. Instead of granting access rights on individual mail folders to individual accounts, the access rights can be granted to an access group
266 \(lqname\(rq, and all members of this group get the specified access rights\.
268 The access group name
269 \(lqadministrators\(rq
270 is a reserved group\. All accounts in the
272 group automatically receive all rights to all accessible folders\.
275 .nr an-no-space-flag 1
279 This option may be specified multiple times to specify that the account belongs to multiple account groups\.
282 sharedgroup=\fIname\fR
284 Append "name" to the name of the top level virtual shared folder index file\. This setting restricts which virtual shared folders this account could possibly access (and that\'s on top of whatever else the access control lists say)\. See the virtual shared folder documentation for more information\.
286 For technical reasons, group names may not include comma, tab, "/" or "|" characters\.
291 \fI\fBauthlib\fR(3)\fR\&[2],
292 \fI\fBauth_login\fR(3)\fR\&[1],
293 \fI\fBauth_getuserinfo\fR(3)\fR\&[3],
294 \fI\fBauth_enumerate\fR(3)\fR\&[4],
295 \fI\fBauth_passwd\fR(3)\fR\&[5],
296 \fI\fBauth_getoption\fR(3)\fR\&[6]\.
309 \fBauth_getuserinfo\fR(3)
311 \%auth_getuserinfo.html
314 \fBauth_enumerate\fR(3)
316 \%auth_enumerate.html
324 \fBauth_getoption\fR(3)
326 \%auth_getoption.html