---
name: "pam_authenticate"
section: "3"
platform: "linux"
package: "pam"
version: "1.7.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/pam_authenticate"
---

# pam\_authenticate(3)

account authentication

## NAME

pam\_authenticate - account authentication

## SYNOPSIS

```
#include <security/pam_appl.h>
```

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

## DESCRIPTION

The **pam\_authenticate** function is used to authenticate the user. The user is required to provide an authentication token depending upon the authentication service, usually this is a password, but could also be a finger print.

The PAM service module may request that the user enter their username via the conversation mechanism (see [**pam\_start**(3)](/pam_start/3.md) and [**pam\_conv**(3)](/pam_conv/3.md)). The name of the authenticated user will be present in the PAM item PAM\_USER. This item may be recovered with a call to [**pam\_get\_item**(3)](/pam_get_item/3.md).

The *pamh* argument is an authentication handle obtained by a prior call to pam\_start(). 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

The PAM module service should return PAM\_AUTH\_ERR if the user does not have a registered authentication token.

## RETURN VALUES

PAM\_ABORT

The application should exit immediately after calling [**pam\_end**(3)](/pam_end/3.md) first.

PAM\_AUTH\_ERR

The user was not authenticated.

PAM\_CRED\_INSUFFICIENT

For some reason the application does not have sufficient credentials to authenticate the user.

PAM\_AUTHINFO\_UNAVAIL

The modules were not able to access the authentication information. This might be due to a network or hardware failure etc.

PAM\_MAXTRIES

One or more of the authentication modules has reached its limit of tries authenticating the user. Do not try again.

PAM\_SUCCESS

The user was successfully authenticated.

PAM\_USER\_UNKNOWN

User unknown to authentication service.

## SEE ALSO

[**pam\_start**(3)](/pam_start/3.md), [**pam\_setcred**(3)](/pam_setcred/3.md), [**pam\_chauthtok**(3)](/pam_chauthtok/3.md), [**pam\_strerror**(3)](/pam_strerror/3.md), [**pam**(8)](/pam/8.md)
