Authen-SASL-Cyrus

 view release on metacpan or  search on metacpan

t/callback.t  view on Meta::CPAN

                            'mechanism' => 'DIGEST-MD5',
                            'user' => sub { ok(1); return 'somebody' },
                           ) or die;
ok(&{$sasl->{callback}->{pass}} eq 'secret');
ok(&{$sasl->{callback}->{user}} eq 'somebody');
ok(&{$sasl->{user}} eq 'somebody');
ok($sasl->{mechanism} eq 'DIGEST-MD5');
#my $con = $sasl->client_new('imap', 'localhost')
#  or die $sasl->error;
#my $so = 'nonce="3QcmMSzgYToomMPhU7qOrM58XdeVZ9pAIZ+d9AWie1A=",realm="localhost",qop="auth,auth-int,auth-conf",cipher="rc4-40,rc4-56,rc4
#maxbuf=4096,charset=utf-8,algorithm=md5-sess';
#my $step = $con->client_step($so);
#ok($step);

t/user.t  view on Meta::CPAN


my $sasl= Authen::SASL->new('DIGEST-MD5') or die;
$sasl->callback('auth' => 'harness',
                'password' => 'secret',
                'user' => 'somebody',
               );
my $con = $sasl->client_new('imap', 'localhost')
  or die $sasl->error;

my $server_output='nonce="3QcmMSzgYToomMPhU7qOrM58XdeVZ9pAIZ+d9AWie1A=",realm="perltest",qop="auth,auth-int,auth-conf",cipher="rc4-40,rc
56,rc4",maxbuf=4096,charset=utf-8,algorithm=md5-sess';

my $step = $con->client_step($server_output) or die $con->error;

$step =~ /authzid="(.*?)"/;
ok($1 eq 'somebody');
$step =~ /username="(.*?)"/;
ok($1 eq 'harness');

$sasl= Authen::SASL->new('mechanism' => 'DIGEST-MD5',
                         'callback'  => {



( run in 0.262 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )