2008-12-31 16:10:02 +01:00
|
|
|
##@file
|
|
|
|
# Cross domain extension for Lemonldap::NG portals.
|
|
|
|
|
|
|
|
##@class
|
|
|
|
# Cross domain extension for Lemonldap::NG portals.
|
2007-02-23 06:31:32 +01:00
|
|
|
package Lemonldap::NG::Portal::CDA;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use Lemonldap::NG::Portal::SharedConf qw(:all);
|
|
|
|
|
2009-02-17 16:39:14 +01:00
|
|
|
our $VERSION = '0.05';
|
2008-12-04 14:53:05 +01:00
|
|
|
use base ('Lemonldap::NG::Portal::SharedConf');
|
2007-02-23 06:31:32 +01:00
|
|
|
|
|
|
|
*EXPORT_OK = *Lemonldap::NG::Portal::SharedConf::EXPORT_OK;
|
|
|
|
*EXPORT_TAGS = *Lemonldap::NG::Portal::SharedConf::EXPORT_TAGS;
|
|
|
|
*EXPORT = *Lemonldap::NG::Portal::SharedConf::EXPORT;
|
|
|
|
|
|
|
|
##################
|
|
|
|
# OVERLOADED SUB #
|
|
|
|
##################
|
|
|
|
|
2009-02-17 16:39:14 +01:00
|
|
|
## @cmethod Lemonldap::NG::Portal::CDA new()
|
|
|
|
# @return Lemonldap::NG::Portal::CDA object
|
|
|
|
sub new {
|
|
|
|
my $class = shift;
|
|
|
|
my $self = $class->SUPER::new(@_);
|
|
|
|
$self->{CDA} = 1;
|
|
|
|
return $self;
|
2007-02-23 06:31:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
__END__
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
Lemonldap::NG::Portal::CDA - Perl extension for building Lemonldap::NG
|
|
|
|
compatible portals with Cross Domain Authentication.
|
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
use Lemonldap::NG::Portal::SharedConf;
|
|
|
|
my $portal = new Lemonldap::NG::Portal::SharedConf( {
|
|
|
|
configStorage => {
|
|
|
|
type => 'DBI',
|
|
|
|
dbiChain => "dbi:mysql:...",
|
|
|
|
dbiUser => "lemonldap",
|
|
|
|
dbiPassword => "password",
|
|
|
|
dbiTable => "lmConfig",
|
|
|
|
},
|
|
|
|
} );
|
|
|
|
|
|
|
|
if($portal->process()) {
|
|
|
|
# Write here the menu with CGI methods. This page is displayed ONLY IF
|
|
|
|
# the user was not redirected here.
|
2008-06-06 05:51:39 +02:00
|
|
|
print $portal->header('text/html; charset=utf8'); # DON'T FORGET THIS (see L<CGI(3)>)
|
2007-02-23 06:31:32 +01:00
|
|
|
print "...";
|
|
|
|
|
|
|
|
# or redirect the user to the menu
|
|
|
|
print $portal->redirect( -uri => 'https://portal/menu');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
# Write here the html form used to authenticate with CGI methods.
|
|
|
|
# $portal->error returns the error message if athentification failed
|
|
|
|
# Warning: by defaut, input names are "user" and "password"
|
2008-06-06 05:51:39 +02:00
|
|
|
print $portal->header('text/html; charset=utf8'); # DON'T FORGET THIS (see L<CGI(3)>)
|
2007-02-23 06:31:32 +01:00
|
|
|
print "...";
|
|
|
|
print '<form method="POST">';
|
|
|
|
# In your form, the following value is required for redirection
|
|
|
|
print '<input type="hidden" name="url" value="'.$portal->param('url').'">';
|
|
|
|
# Next, login and password
|
|
|
|
print 'Login : <input name="user"><br>';
|
|
|
|
print 'Password : <input name="password" type="password" autocomplete="off">';
|
|
|
|
print '<input type="submit" value="go" />';
|
|
|
|
print '</form>';
|
|
|
|
}
|
|
|
|
|
|
|
|
Modify your httpd.conf:
|
|
|
|
|
|
|
|
<Location /My/File>
|
|
|
|
SSLVerifyClient require
|
|
|
|
SSLOptions +ExportCertData +CompatEnvVars +StdEnvVars
|
|
|
|
</Location>
|
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
2008-05-12 15:36:36 +02:00
|
|
|
This library just overload few methods of L<Lemonldap::NG::Portal::SharedConf>
|
2007-02-23 06:31:32 +01:00
|
|
|
to add Cross Domain Authentication. Handlers that are not used in the same
|
2008-05-12 15:36:36 +02:00
|
|
|
domain than the portal must inherit from L<Lemonldap::NG::Handler::CDA>.
|
2007-02-23 06:31:32 +01:00
|
|
|
|
|
|
|
See L<Lemonldap::NG::Portal::SharedConf> for usage and other methods.
|
|
|
|
|
|
|
|
=head1 SEE ALSO
|
|
|
|
|
|
|
|
L<Lemonldap::NG::SharedConf>, L<Lemonldap::NG::Handler>,
|
2007-04-02 21:13:05 +02:00
|
|
|
L<Lemonldap::NG::Handler::CDA>,
|
|
|
|
http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/Presentation
|
2007-02-23 06:31:32 +01:00
|
|
|
|
|
|
|
=head1 AUTHOR
|
|
|
|
|
|
|
|
Xavier Guimard, E<lt>x.guimard@free.frE<gt>
|
|
|
|
|
2007-04-14 15:12:11 +02:00
|
|
|
=head1 BUG REPORT
|
|
|
|
|
|
|
|
Use OW2 system to report bug or ask for features:
|
|
|
|
L<http://forge.objectweb.org/tracker/?group_id=274>
|
|
|
|
|
|
|
|
=head1 DOWNLOAD
|
|
|
|
|
|
|
|
Lemonldap::NG is available at
|
|
|
|
L<http://forge.objectweb.org/project/showfiles.php?group_id=274>
|
|
|
|
|
2007-02-23 06:31:32 +01:00
|
|
|
=head1 COPYRIGHT AND LICENSE
|
|
|
|
|
|
|
|
Copyright (C) 2007 by Xavier Guimard E<lt>x.guimard@free.frE<gt>
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.4 or,
|
|
|
|
at your option, any later version of Perl 5 you may have available.
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|