---
name: "pam_authenticate"
section: "3"
platform: "macos"
package: "OpenPAM"
version: "35"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/pam_authenticate"
---

# pam\_authenticate(3)

perform authentication within the PAM framework

## NAME

**pam\_authenticate** – perform authentication within the PAM framework

## LIBRARY

library “libpam”

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<security/pam\_appl.h\>**

*int*\

**pam\_authenticate**(*pam\_handle\_t \*pamh*, *int flags*);

## DESCRIPTION

The **pam\_authenticate** function attempts to authenticate the user associated with the pam context specified by the *pamh* argument.

The application is free to call **pam\_authenticate** as many times as it wishes, but some modules may maintain an internal retry counter and return PAM\_MAXTRIES when it exceeds some preset or hardcoded limit.

The *flags* argument is the binary or of zero or more of the following values:

- PAM\_SILENT

  Do not emit any messages.

- PAM\_DISALLOW\_NULL\_AUTHTOK

  Fail if the user's authentication token is null.

If any other bits are set, **pam\_authenticate** will return PAM\_SYMBOL\_ERR.

## RETURN VALUES

The **pam\_authenticate** function returns one of the following values:

- \[PAM\_ABORT\]

  General failure.

- \[PAM\_AUTHINFO\_UNAVAIL\]

  Authentication information is unavailable.

- \[PAM\_AUTH\_ERR\]

  Authentication error.

- \[PAM\_BUF\_ERR\]

  Memory buffer error.

- \[PAM\_CONV\_ERR\]

  Conversation failure.

- \[PAM\_CRED\_INSUFFICIENT\]

  Insufficient credentials.

- \[PAM\_MAXTRIES\]

  Maximum number of tries exceeded.

- \[PAM\_PERM\_DENIED\]

  Permission denied.

- \[PAM\_SERVICE\_ERR\]

  Error in service module.

- \[PAM\_SYMBOL\_ERR\]

  Invalid symbol.

- \[PAM\_SYSTEM\_ERR\]

  System error.

- \[PAM\_USER\_UNKNOWN\]

  Unknown user.

## SEE ALSO

[pam(3)](/pam/3.md), [pam\_strerror(3)](/pam_strerror/3.md)

## STANDARDS

*X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules*, June 1997.

## AUTHORS

The **pam\_authenticate** function and this manual page were developed for the FreeBSD Project by ThinkSec AS and Network Associates Laboratories, the Security Research Division of Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (“CBOSS”), as part of the DARPA CHATS research program.
