Authen-NZRealMe
view release on metacpan or search on metacpan
lib/Authen/NZRealMe.pm view on Meta::CPAN
push @req_options, allow_create => $allow_create;
}
my $acs_index = $opt->{acs_index} // 'default';
push @req_options, acs_index => $acs_index;
my $req = $sp->new_request( @req_options );
print "Request ID: ", $req->request_id, "\n" if -t 1;
print $req->as_url, "\n";
}
sub _dispatch_dump_req {
my $class = shift;
my $opt = shift;
$class->class_for('authen_request')->dump_request(@_);
}
sub _dispatch_resolve {
my $class = shift;
my $opt = shift;
my $artifact = shift or die "Must provide artifact or URL\n";
my $request_id = shift or die "Must provide ID from original request\n";
my $sp = $class->_sp_from_opt($opt);
my %args = (
artifact => $artifact,
request_id => $request_id,
);
$args{resolve_flt} = 1 if $opt->{resolve_flt};
$args{logon_strength} = shift if @_;
$args{strength_match} = shift if @_;
$args{_to_file_} = $opt->{to_file} if $opt->{to_file};
$args{_from_file_} = $opt->{from_file} if $opt->{from_file};
my $response = eval {
$sp->resolve_artifact(%args);
};
if($@) {
print "Failed to resolve artifact:\n$@";
exit 1;
}
print $response->as_string();
}
sub _dispatch_version {
print $Authen::NZRealMe::VERSION, "\n";
}
sub _conf_dir {
my($opt) = @_;
if($opt->{conf_dir}) {
$opt->{conf_dir} =~ s{/\z}{};
return $opt->{conf_dir} if -d $opt->{conf_dir};
die "Directory does not exist: $opt->{conf_dir}";
}
my $cmnd = (caller(1))[3];
$cmnd =~ s/^.*::_dispatch_//;
$cmnd =~ s/_/-/g;
die "$cmnd command needs --conf-dir option\n";
}
sub init_readline {
require Term::ReadLine; # Was not needed until now
my $term = Term::ReadLine->new('nzrealme');
if($term and $term->can('ornaments')) {
$term->ornaments(0);
}
if(not exists $INC{'Term/ReadLine/Gnu.pm'}) {
warn "Consider installing Term::ReadLine::Gnu for better terminal handling.\n\n";
}
return $term;
}
1;
__END__
=head1 IMPLEMENTATION DETAILS
This module does not implement 100% of the APIs exposed by the RealMe service.
It does support both the 'Artifact' binding and the 'POST' binding options.
The module also does not currently implement the RCMS API. Once again, this
is because the authors have not yet needed RCMS functionality. Patches are
welcome for this too.
=head1 GETTING STARTED
You cannot simply drop some config files in a directory and start
authenticating users. Your agency will need to establish a Service Provider
role with the logon service and complete the required integration steps. Your
first step should be to make contact with the DIA/RealMe team and arrange a
meeting.
(Actually, it appears that you I<can> now set up a working integration with at
least the RealMe MTS test service without having to engage formally with RealMe
or DIA).
=head1 CODE INTEGRATION
To integrate the RealMe login service with your application, you will need to:
=over 4
=item 1
complete a number of configuration steps (see L</CONFIGURATION> below)
( run in 2.616 seconds using v1.01-cache-2.11-cpan-302cb4679cc )