Improve unit test to check that RP rule is working
This commit is contained in:
parent
7dabb0b896
commit
128ab23246
|
@ -105,7 +105,24 @@ ok( $res = $op->_get( $url, query => $query, accept => 'text/html' ),
|
||||||
count(1);
|
count(1);
|
||||||
expectOK($res);
|
expectOK($res);
|
||||||
|
|
||||||
# Try to authenticate to OP
|
# Try to authenticate to OP with unallowed user
|
||||||
|
my $failquery = "user=rtyler&password=rtyler&$query";
|
||||||
|
ok(
|
||||||
|
$res = $op->_post(
|
||||||
|
$url,
|
||||||
|
IO::String->new($failquery),
|
||||||
|
accept => 'text/html',
|
||||||
|
length => length($failquery),
|
||||||
|
),
|
||||||
|
"Post authentication, endpoint $url"
|
||||||
|
);
|
||||||
|
count(1);
|
||||||
|
my $idpId = expectCookie($res);
|
||||||
|
|
||||||
|
# Should be denied by rule
|
||||||
|
expectPortalError( $res, 84 );
|
||||||
|
|
||||||
|
# Try to authenticate to OP with allowed user
|
||||||
$query = "user=french&password=french&$query";
|
$query = "user=french&password=french&$query";
|
||||||
ok(
|
ok(
|
||||||
$res = $op->_post(
|
$res = $op->_post(
|
||||||
|
@ -117,7 +134,7 @@ ok(
|
||||||
"Post authentication, endpoint $url"
|
"Post authentication, endpoint $url"
|
||||||
);
|
);
|
||||||
count(1);
|
count(1);
|
||||||
my $idpId = expectCookie($res);
|
$idpId = expectCookie($res);
|
||||||
my ( $host, $tmp );
|
my ( $host, $tmp );
|
||||||
( $host, $tmp, $query ) = expectForm( $res, '#', undef, 'confirm' );
|
( $host, $tmp, $query ) = expectForm( $res, '#', undef, 'confirm' );
|
||||||
|
|
||||||
|
@ -334,7 +351,8 @@ sub op {
|
||||||
oidcRPMetaDataOptionsUserIDAttr => "",
|
oidcRPMetaDataOptionsUserIDAttr => "",
|
||||||
oidcRPMetaDataOptionsAccessTokenExpiration => 3600,
|
oidcRPMetaDataOptionsAccessTokenExpiration => 3600,
|
||||||
oidcRPMetaDataOptionsPostLogoutRedirectUris =>
|
oidcRPMetaDataOptionsPostLogoutRedirectUris =>
|
||||||
"http://auth.rp.com/?logout=1"
|
"http://auth.rp.com/?logout=1",
|
||||||
|
oidcRPMetaDataOptionsRule => '$uid eq "french"',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
oidcOPMetaDataOptions => {},
|
oidcOPMetaDataOptions => {},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user