'\" te .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. .\" 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. .\" 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. .\" 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] .TH pam_sm_authenticate 3PAM "27 Jan 2005" "SunOS 5.11" "PAM Library Functions" .SH NAME pam_sm_authenticate \- service provider implementation for pam_authenticate .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lpam\fR [ \fIlibrary\fR... ] #include #include \fBint\fR \fBpam_sm_authenticate\fR(\fBpam_handle_t *\fR\fIpamh\fR, \fBint\fR \fIflags\fR, \fBint\fR \fIargc\fR, \fBconst char **\fR\fIargv\fR); .fi .SH DESCRIPTION .sp .LP In response to a call to \fBpam_authenticate\fR(3PAM), the \fBPAM\fR framework calls \fBpam_sm_authenticate()\fR from the modules listed in the \fBpam.conf\fR(4) file. The authentication provider supplies the back-end functionality for this interface function. .sp .LP The \fBpam_sm_authenticate()\fR function is called to verify the identity of the current user. The user is usually required to enter a password or similar authentication token depending upon the authentication scheme configured within the system. The user in question is specified by a prior call to \fBpam_start()\fR, and is referenced by the authentication handle \fIpamh\fR. .sp .LP If the user is unknown to the authentication service, the service module should mask this error and continue to prompt the user for a password. It should then return the error, \fBPAM_USER_UNKNOWN\fR. .sp .LP The following flag may be passed in to \fBpam_sm_authenticate()\fR: .sp .ne 2 .mk .na \fB\fBPAM_SILENT\fR\fR .ad .RS 29n .rt The authentication service should not generate any messages. .RE .sp .ne 2 .mk .na \fB\fBPAM_DISALLOW_NULL_AUTHTOK\fR\fR .ad .RS 29n .rt The authentication service should return .RE .sp .ne 2 .mk .na \fB\fBPAM_AUTH_ERR\fR\fR .ad .RS 29n .rt The user has a null authentication token. .RE .sp .LP The \fIargc\fR argument represents the number of module options passed in from the configuration file \fBpam.conf\fR(4). \fIargv\fR specifies the module options, which are interpreted and processed by the authentication service. Please refer to the specific module man pages for the various available \fIoptions\fR. If any unknown option is passed in, the module should log the error and ignore the option. .sp .LP Before returning, \fBpam_sm_authenticate()\fR should call \fBpam_get_item()\fR and retrieve \fBPAM_AUTHTOK\fR. If it has not been set before and the value is \fINULL\fR, \fBpam_sm_authenticate()\fR should set it to the password entered by the user using \fBpam_set_item()\fR. .sp .LP An authentication module may save the authentication status (success or reason for failure) as state in the authentication handle using \fBpam_set_data\fR(3PAM). This information is intended for use by \fBpam_setcred()\fR. .SH RETURN VALUES .sp .LP Upon successful completion, \fBPAM_SUCCESS\fR must be returned. In addition, the following values may be returned: .sp .ne 2 .mk .na \fB\fBPAM_MAXTRIES\fR\fR .ad .RS 25n .rt Maximum number of authentication attempts exceeded. .RE .sp .ne 2 .mk .na \fB\fBPAM_AUTH_ERR\fR\fR .ad .RS 25n .rt Authentication failure. .RE .sp .ne 2 .mk .na \fB\fBPAM_CRED_INSUFFICIENT\fR\fR .ad .RS 25n .rt Cannot access authentication data due to insufficient credentials. .RE .sp .ne 2 .mk .na \fB\fBPAM_AUTHINFO_UNAVAIL\fR\fR .ad .RS 25n .rt Underlying authentication service can not retrieve authentication information. .RE .sp .ne 2 .mk .na \fB\fBPAM_USER_UNKNOWN\fR\fR .ad .RS 25n .rt User not known to underlying authentication module. .RE .sp .ne 2 .mk .na \fB\fBPAM_IGNORE\fR\fR .ad .RS 25n .rt Ignore underlying authentication module regardless of whether the control flag is \fIrequired\fR,\fIoptional,\fR or \fIsufficient\fR1. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for description of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface Stability Stable _ MT-LevelMT-Safe with exceptions .TE .SH SEE ALSO .sp .LP \fBpam\fR(3PAM), \fBpam_authenticate\fR(3PAM), \fBpam_get_item\fR(3PAM), \fBpam_set_data\fR(3PAM), \fBpam_set_item\fR(3PAM), \fBpam_setcred\fR(3PAM), \fBpam_start\fR(3PAM), \fBlibpam\fR(3LIB), \fBpam.conf\fR(4), \fBattributes\fR(5) .SH NOTES .sp .LP Modules should not retry the authentication in the event of a failure. Applications handle authentication retries and maintain the retry count. To limit the number of retries, the module can return a \fBPAM_MAXTRIES\fR error. .sp .LP The interfaces in \fBlibpam\fR are MT-Safe only if each thread within the multithreaded application uses its own \fBPAM\fR handle. .sp .LP If the \fBPAM_REPOSITORY\fR \fIitem_type\fR is set and a service module does not recognize the type, the service module does not process any information, and returns \fBPAM_IGNORE\fR. If the \fBPAM_REPOSITORY\fR \fIitem_type\fR is not set, a service module performs its default action.