---
name: "Authen::Smb"
section: "3pm"
platform: "linux"
package: "libauthen-smb-perl"
version: "0.91-8+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Authen::Smb"
---

# Authen::Smb(3pm)

Perl extension to authenticate against an SMB server

## NAME

Authen::Smb - Perl extension to authenticate against an SMB server

## SYNOPSIS

```
  use Authen::Smb;
  my $authResult = Authen::Smb::authen('myUser',
                                       'myPassword',
                                       'myPDC',
                                       'myBDC',
                                       'myNTDomain');
  if ( $authResult == Authen::Smb::NO_ERROR ) {
    print "User successfully authenticated.\n";
  } else {
    print "User not authenticated with error level $authResult\n";
  }
```

## DESCRIPTION

Authen::Smb allows you to authenticate a user against an NT domain.  You can specify both a primary and a backup server to use for authentication.  The NT names of the machines should be used for specifying servers.

An authentication request will return one of four values:

NTV\_NO\_ERROR (0) NTV\_SERVER\_ERROR (1) NTV\_PROTOCOL\_ERROR (2) NTV\_LOGON\_ERROR (3)

NTV\_NO\_ERROR is the only return value possible for a successful authentication. All other return values indicate failure, of one sort or another.

## EXPORT\_OK constants

```
  NTV_LOGON_ERROR
  NTV_NO_ERROR
  NTV_PROTOCOL_ERROR
  NTV_SERVER_ERROR
```

## AUTHOR

Patrick Michael Kane, modus@pr.es.to Based on the smbval library from the samba package

## SEE ALSO

[**perl**(1)](/perl/1.md).
