Some errors in CAS (#1461)
This commit is contained in:
parent
8596b339e8
commit
28aedcd63c
|
@ -32,7 +32,7 @@ sub new {
|
||||||
}
|
}
|
||||||
$self->env->{PATH_INFO} ||= '/';
|
$self->env->{PATH_INFO} ||= '/';
|
||||||
$self->{uri} = uri_unescape( $self->env->{REQUEST_URI} );
|
$self->{uri} = uri_unescape( $self->env->{REQUEST_URI} );
|
||||||
$self->{uri} =~ s|//+|/|g;
|
$self->{uri} =~ s|^//+|/|g;
|
||||||
$self->{datas} = {};
|
$self->{datas} = {};
|
||||||
$self->{error} = 0;
|
$self->{error} = 0;
|
||||||
$self->{respHeaders} = [];
|
$self->{respHeaders} = [];
|
||||||
|
|
|
@ -657,7 +657,7 @@ sub fullUrl {
|
||||||
my ( $self, $req ) = @_;
|
my ( $self, $req ) = @_;
|
||||||
my $pHost = $self->conf->{portal};
|
my $pHost = $self->conf->{portal};
|
||||||
$pHost =~ s#^(https?://[^/]+)(?:/.*)?$#$1#;
|
$pHost =~ s#^(https?://[^/]+)(?:/.*)?$#$1#;
|
||||||
return $pHost . $req->uri;
|
return $pHost . $req->env->{REQUEST_URI};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub cookie {
|
sub cookie {
|
||||||
|
|
|
@ -197,8 +197,6 @@ qr'^http://auth.idp.com/cas/login\?(service=http%3A%2F%2Fauth.proxy.com%2F.*)$'
|
||||||
'Push CAS response to proxy'
|
'Push CAS response to proxy'
|
||||||
);
|
);
|
||||||
|
|
||||||
print STDERR Dumper($url);
|
|
||||||
skip( 'Bug found', 6 );
|
|
||||||
my $proxyId = expectCookie($res);
|
my $proxyId = expectCookie($res);
|
||||||
( $host, $url, $query ) =
|
( $host, $url, $query ) =
|
||||||
expectAutoPost( $res, 'auth.sp.com', '/saml/proxySingleSignOnPost',
|
expectAutoPost( $res, 'auth.sp.com', '/saml/proxySingleSignOnPost',
|
||||||
|
@ -215,6 +213,7 @@ qr'^http://auth.idp.com/cas/login\?(service=http%3A%2F%2Fauth.proxy.com%2F.*)$'
|
||||||
),
|
),
|
||||||
'Post SAML response to SP'
|
'Post SAML response to SP'
|
||||||
);
|
);
|
||||||
|
skip( 'Bug found', 5 );
|
||||||
|
|
||||||
# Verify authentication on SP
|
# Verify authentication on SP
|
||||||
expectRedirection( $res, 'http://auth.sp.com' );
|
expectRedirection( $res, 'http://auth.sp.com' );
|
||||||
|
|
|
@ -5,6 +5,7 @@ use strict;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
use LWP::UserAgent;
|
use LWP::UserAgent;
|
||||||
use URI::Escape;
|
use URI::Escape;
|
||||||
|
use Lemonldap::NG::Common::FormEncode;
|
||||||
use 5.10.0;
|
use 5.10.0;
|
||||||
|
|
||||||
no warnings 'redefine';
|
no warnings 'redefine';
|
||||||
|
@ -127,9 +128,7 @@ m@<form.+?action="(?:(?:http://([^/]+))?(/.*?)?|(#))".+method="(post|get)"@is,
|
||||||
my %fields =
|
my %fields =
|
||||||
( $res->[2]->[0] =~
|
( $res->[2]->[0] =~
|
||||||
m#<input.+?name="([^"]+)"[^>]+?value="([^"]*?)"#gs );
|
m#<input.+?name="([^"]+)"[^>]+?value="([^"]*?)"#gs );
|
||||||
my $query = join( '&',
|
my $query = build_urlencoded(%fields);
|
||||||
map { "$_=" . uri_escape( uri_unescape( $fields{$_} ) ) }
|
|
||||||
keys(%fields) );
|
|
||||||
foreach my $f (@requiredFields) {
|
foreach my $f (@requiredFields) {
|
||||||
ok( defined $fields{$f}, qq{ Field "$f" is defined} );
|
ok( defined $fields{$f}, qq{ Field "$f" is defined} );
|
||||||
count(1);
|
count(1);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user