2009-02-23 18:35:38 +01:00
|
|
|
## @file
|
|
|
|
# Remote authentication module
|
|
|
|
|
|
|
|
## @class
|
|
|
|
# Remote authentication module: It simply check the remote session using cross
|
|
|
|
# domain mechanism.
|
|
|
|
package Lemonldap::NG::Portal::AuthRemote;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use Lemonldap::NG::Portal::_Remote;
|
|
|
|
use Lemonldap::NG::Portal::Simple;
|
|
|
|
use base qw(Lemonldap::NG::Portal::_Remote);
|
|
|
|
|
2009-06-08 18:29:13 +02:00
|
|
|
our $VERSION = '0.1';
|
|
|
|
|
2009-02-23 18:35:38 +01:00
|
|
|
*authInit = *Lemonldap::NG::Portal::_Remote::init;
|
|
|
|
|
|
|
|
## @apmethod int extractFormInfo()
|
|
|
|
# Call checkRemoteId() and set $self->{user} and $self->{password}
|
|
|
|
# @return Lemonldap::NG::Portal constant
|
|
|
|
sub extractFormInfo {
|
|
|
|
my $self = shift;
|
|
|
|
my $r = $self->checkRemoteId();
|
|
|
|
return $r unless ( $r == PE_OK );
|
|
|
|
$self->{user} =
|
|
|
|
$self->{rSessionInfo}->{ $self->{remoteUserField} || 'uid' };
|
|
|
|
$self->{password} = $self->{rSessionInfo}->{'_password'};
|
|
|
|
PE_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
## @apmethod int setAuthSessionInfo()
|
|
|
|
# Delete stored password if local policy does not accept stored passwords.
|
|
|
|
# @return Lemonldap::NG::Portal constant
|
|
|
|
sub setAuthSessionInfo {
|
2009-05-26 14:24:03 +02:00
|
|
|
my $self = shift;
|
2009-05-25 14:59:57 +02:00
|
|
|
|
|
|
|
# Store user login for basic rules
|
|
|
|
$self->{sessionInfo}->{'_user'} = $self->{'user'};
|
|
|
|
|
2009-12-11 22:17:06 +01:00
|
|
|
# Store password (deleted in checkRemoteId() if local policy does not accept
|
|
|
|
#stored passwords)
|
2009-05-25 14:59:57 +02:00
|
|
|
$self->{sessionInfo}->{'_password'} = $self->{'password'};
|
|
|
|
|
2009-02-23 18:35:38 +01:00
|
|
|
PE_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
## @apmethod int authenticate()
|
|
|
|
# Does nothing.
|
|
|
|
# @return Lemonldap::NG::Portal constant
|
|
|
|
sub authenticate {
|
|
|
|
PE_OK;
|
|
|
|
}
|
|
|
|
|
2010-09-01 10:59:39 +02:00
|
|
|
## @apmethod int authFinish()
|
|
|
|
# Does nothing.
|
|
|
|
# @return Lemonldap::NG::Portal constant
|
|
|
|
sub authFinish {
|
|
|
|
PE_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
## @apmethod int authLogout()
|
|
|
|
# Does nothing
|
|
|
|
# @return Lemonldap::NG::Portal constant
|
|
|
|
sub authLogout {
|
|
|
|
PE_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
## @apmethod boolean authForce()
|
|
|
|
# Does nothing
|
|
|
|
# @return result
|
|
|
|
sub authForce {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-02-23 18:35:38 +01:00
|
|
|
1;
|
|
|
|
|
2009-03-03 07:21:52 +01:00
|
|
|
__END__
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
2010-01-03 09:09:59 +01:00
|
|
|
=encoding utf8
|
|
|
|
|
2009-03-03 07:21:52 +01:00
|
|
|
Lemonldap::NG::Portal::AuthRemote - Authentication module for Lemonldap::NG
|
|
|
|
that delegates authentication to a remote Lemonldap::NG portal.
|
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
use Lemonldap::NG::Portal::Simple;
|
|
|
|
my $portal = new Lemonldap::NG::Portal::Simple(
|
|
|
|
|
|
|
|
# AUTHENTICATION PART
|
|
|
|
authentication => 'Remote',
|
|
|
|
remotePortal => 'https://auth.remote.com/',
|
|
|
|
# Example with SOAP access to remote session DB
|
|
|
|
remoteGlobalStorage => 'Lemonldap::NG::Common::Apache::Session::SOAP',
|
|
|
|
remoteGlobalStorageOptions => {
|
|
|
|
proxy => 'https://auth.remote.com/index.pl/sessions',
|
|
|
|
ns => 'urn://auth.remote.com/Lemonldap/NG/Common/CGI/SOAPService',
|
|
|
|
user => 'myuser',
|
|
|
|
password => 'mypass',
|
|
|
|
}
|
|
|
|
# Optional parameters if remote parameters are not the same.
|
|
|
|
# Example with default values:
|
|
|
|
remoteCookieName => 'lemonldap',
|
|
|
|
remoteUserField => 'uid',
|
|
|
|
|
|
|
|
# USER DATABASE PART (not required if remote users exists in your DB)
|
|
|
|
userDB => 'Remote',
|
|
|
|
);
|
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
|
|
|
Authentication module for Lemonldap::NG portal that delegates authentication to
|
|
|
|
a remote portal.
|
|
|
|
|
|
|
|
=head1 SEE ALSO
|
|
|
|
|
2010-10-26 11:34:00 +02:00
|
|
|
L<http://lemonldap-ng.org/>
|
2009-03-03 07:21:52 +01:00
|
|
|
|
|
|
|
=head1 AUTHOR
|
|
|
|
|
|
|
|
Xavier Guimard, E<lt>x.guimard@free.frE<gt>
|
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE
|
|
|
|
|
2010-10-23 10:35:38 +02:00
|
|
|
Copyright (C) 2009, 2010 by Xavier Guimard
|
2009-03-03 07:21:52 +01:00
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.10.0 or,
|
|
|
|
at your option, any later version of Perl 5 you may have available.
|
|
|
|
|
|
|
|
=cut
|