1 .\" <!-- $Id: auth_login.sgml,v 1.4 2007/07/21 20:05:53 mrsam Exp $ -->
2 .\" <!-- Copyright 2004 Double Precision, Inc. See COPYING for -->
3 .\" <!-- distribution information. -->
6 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
8 .\" Manual: Double Precision, Inc.
9 .\" Source: Double Precision, Inc.
11 .TH "AUTH_LOGIN" "3" "07/21/2007" "Double Precision, Inc." "Double Precision, Inc."
12 .\" disable hyphenation
14 .\" disable justification (adjust text to left margin only)
17 auth_login \- Validate a userid and password
22 #include <courierauth.h>
26 .BI "int rc=auth_login(const\ char\ *" "service" ", const\ char\ *" "userid" ", const\ char\ *" "password" ", int\ " "(*callback_func)" "(struct\ authinfo\ *,\ void\ *), void\ *" "callback_arg" ");"
33 exists, and whether it's
37 specifies which so\-called "service" is being authenticated; like
42 may or may not be used by the Courier authentication library's configured back\-end module.
50 \fBcallback_func\fR's return value becomes the return value from
52 (which should be 0, by convention).
54 will not be invoked if an error occurs, which is reported by a non\-zero return value from
55 \fBauth_login\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.
57 The second argument to
60 \fBcallback_arg\fR, which is not interpreted by this function in any way. The first argument will be a pointer to the following structure:
61 \fBExample\ 1.\ struct authinfo\fR
66 const char *sysusername;
67 const uid_t *sysuserid;
76 const char *clearpasswd;
84 Description of the above fields:
88 The authenticated login ID.
93 The authenticated account's userid and groupid can be looked up in the password file using
94 address. If this field is
95 NULL, obtain the userid and the groupid from
109 is initialized, otherwise it's a pointer to the account's numeric userid.
114 Account's numeric groupid.
124 This is the account's full name. This field is optional, it may be
130 The account's home directory. This field cannot be
136 The pathname to the account's mailbox. This field is optional, it can be
138 in which case the default location is assumed.
143 Optional maildir quota on the account's mailbox (and
150 The account's encrypted password, if available. If the account has a cleartext password defined, this field can be set to
151 NULL. The encrypted password can take several formats:
153 \h'-04'\(bu\h'+03'A traditional triple\-DES crypted password, or a MD5+salt\-hashed password, as used in Linux.
158 followed by a base64\-encoded MD5 hash of the password.
163 followed by a base64\-encoded SHA1 hash of the password.
169 The account's cleartext password, if available. If the account has an encrypted password defined, this field can be set to
175 A comma\-separated list of miscellaneous account options. See below for more information.
177 .SS "Account options"
179 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
180 NULL. Otherwise it will be a comma\-separated list of
181 \(lq\fIoption\fR=\fIvalue\fR\(rq
185 .nr an-no-space-flag 1
190 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.
192 The following options are recognized by the various Courier packages:
195 .nr an-no-space-flag 1
200 The application is responsible for enforcing all the
202 option. An authentication request for service
203 \(lqimap\(rq, for example, will succeed provided that the userid and the password are valid, even if
204 \(lqdisableimap=1\(rq
205 is set. The application's
207 should check for this condition, and return a negative return code.
211 If "n" is 1, IMAP access to this account should be disabled.
216 If "n" is 1, POP3 access to this account should be disabled.
219 disablewebmail=\fIn\fR
221 If "n" is 1, webmail access to this account should be disabled.
224 disableshared=\fIn\fR
226 If "n" is 1, this account should not have access to shared folders or be able to share its own folders with other people.
231 This account is a member of access group
232 \fIname\fR. Instead of granting access rights on individual mail folders to individual accounts, the access rights can be granted to an access group
233 \(lqname\(rq, and all members of this group get the specified access rights.
235 The access group name
236 \(lqadministrators\(rq
237 is a reserved group. All accounts in the
239 group automatically receive all rights to all accessible folders.
242 .nr an-no-space-flag 1
246 This option may be specified multiple times to specify that the account belongs to multiple account groups.
249 sharedgroup=\fIname\fR
251 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.
253 For technical reasons, group names may not include comma, tab, "/" or "|" characters.
258 \fI\fBauthlib\fR(3)\fR\&[1],
259 \fI\fBauth_generic\fR(3)\fR\&[2],
260 \fI\fBauth_getuserinfo\fR(3)\fR\&[3],
261 \fI\fBauth_enumerate\fR(3)\fR\&[4],
262 \fI\fBauth_passwd\fR(3)\fR\&[5],
263 \fI\fBauth_getoption\fR(3)\fR\&[6].
271 \fBauth_generic\fR(3)
276 \fBauth_getuserinfo\fR(3)
278 \%auth_getuserinfo.html
281 \fBauth_enumerate\fR(3)
283 \%auth_enumerate.html
291 \fBauth_getoption\fR(3)
293 \%auth_getoption.html