2 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PAM_AUTHENTICATE 3PAM "Jan 27, 2005"
8 pam_authenticate \- perform authentication within the PAM framework
12 \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lpam\fR [ \fIlibrary\fR ... ]
13 #include <security/pam_appl.h>
16 \fBint\fR \fBpam_authenticate\fR(\fBpam_handle_t *\fR\fIpamh\fR, \fBint\fR \fIflags\fR);
22 The \fBpam_authenticate()\fR function is called to authenticate the current
23 user. The user is usually required to enter a password or similar
24 authentication token depending upon the authentication service configured
25 within the system. The user in question should have been specified by a prior
26 call to \fBpam_start()\fR or \fBpam_set_item()\fR.
29 The following flags may be set in the \fIflags\fR field:
33 \fB\fBPAM_SILENT\fR\fR
36 Authentication service should not generate any messages.
42 \fB\fBPAM_DISALLOW_NULL_AUTHTOK\fR\fR
45 The authentication service should return \fBPAM_AUTH_ERR\fR if the user has a
46 null authentication token.
52 Upon successful completion, \fBPAM_SUCCESS\fR is returned. In addition to the
53 error return values described in \fBpam\fR(3PAM), the following values may be
58 \fB\fBPAM_AUTH_ERR\fR\fR
61 Authentication failure.
67 \fB\fBPAM_CRED_INSUFFICIENT\fR\fR
70 Cannot access authentication data due to insufficient credentials.
76 \fB\fBPAM_AUTHINFO_UNAVAIL\fR\fR
79 Underlying authentication service cannot retrieve authentication information.
85 \fB\fBPAM_USER_UNKNOWN\fR\fR
88 User not known to the underlying authentication module.
94 \fB\fBPAM_MAXTRIES\fR\fR
97 An authentication service has maintained a retry count which has been reached.
98 No further retries should be attempted.
104 See \fBattributes\fR(5) for description of the following attributes:
112 ATTRIBUTE TYPE ATTRIBUTE VALUE
114 Interface Stability Stable
116 MT-Level MT-Safe with exceptions
122 \fBpam\fR(3PAM), \fBpam_open_session\fR(3PAM), \fBpam_set_item\fR(3PAM),
123 \fBpam_setcred\fR(3PAM), \fBpam_start\fR(3PAM), \fBlibpam\fR(3LIB),
128 In the case of authentication failures due to an incorrect username or
129 password, it is the responsibility of the application to retry
130 \fBpam_authenticate()\fR and to maintain the retry count. An authentication
131 service module may implement an internal retry count and return an error
132 \fBPAM_MAXTRIES\fR if the module does not want the application to retry.
135 If the \fBPAM\fR framework cannot load the authentication module, then it will
136 return \fBPAM_ABORT\fR. This indicates a serious failure, and the application
137 should not attempt to retry the authentication.
140 For security reasons, the location of authentication failures is hidden from
141 the user. Thus, if several authentication services are stacked and a single
142 service fails, \fBpam_authenticate()\fR requires that the user re-authenticate
143 each of the services.
146 A null authentication token in the authentication database will result in
147 successful authentication unless \fBPAM_DISALLOW_NULL_AUTHTOK\fR was specified.
148 In such cases, there will be no prompt to the user to enter an authentication
152 The interfaces in \fBlibpam\fR are MT-Safe only if each thread within the
153 multithreaded application uses its own \fBPAM\fR handle.