# perldoc > Authen::SASL::Perl::PLAIN

---
type: CommandReference
command: Authen::SASL::Perl::PLAIN
mode: perldoc
section: ""
source: perldoc
---

## Quick Reference

- `$sasl = Authen::SASL->new(mechanism => 'PLAIN', callback => { user => $user, pass => $pass })` — create a PLAIN SASL client object

## Name

Plain Login Authentication class

## Synopsis

perl
use Authen::SASL qw(Perl);

$sasl = Authen::SASL->new(
  mechanism => 'PLAIN',
  callback  => {
    user => $user,
    pass => $pass
  },
);
## Options

Client callbacks:

- `user` — The username to be used for authentication.
- `pass` — The user's password to be used for authentication.
- `authname` — The authorization id to use after successful authentication.

Server callback:

- `checkpass` — Returns true/false depending on the validity of the credentials passed in arguments.

## Examples

perl
# Client example
use Authen::SASL qw(Perl);
my $sasl = Authen::SASL->new(
  mechanism => 'PLAIN',
  callback  => {
    user => 'myuser',
    pass => 'mypassword'
  },
);
## See Also

- [Authen::SASL](https://perldoc.perl.org/Authen::SASL)
- [Authen::SASL::Perl](https://perldoc.perl.org/Authen::SASL::Perl)