LoginSignup
1
1

More than 5 years have passed since last update.

ActiveDirectoryで認証

Posted at

使用モジュール名: Authen::Simple::ActiveDirectory
URL: http://search.cpan.org/~chansen/Authen-Simple-LDAP-0.3/lib/Authen/Simple/ActiveDirectory.pm

予め、cpanmコマンドで上記モジュールをインストールします。
下記を認証のサンプルに使用してください。

test_ad.pl
use warnings;
use strict;
use 5.010;
use Authen::Simple::ActiveDirectory;

        my $host = 'your_AD_address';
    my $ad = Authen::Simple::ActiveDirectory->new(
        host      => $host,
        principal => 'your_domain'
    );
    my $username = 'yasuhiro';
        my $password = 'password';
    if ( $ad->authenticate( $username, $password ) ) {
        # successfull authentication
        say 'success';
    } else {
        say 'fail';
}
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1