Skip to content

Commit de81a37

Browse files
committed
Merge commit 'bee7c3267310548b985fc788bb9ebefc7d8694d7' into dinsic-release-v1.11.x
* commit 'bee7c3267310548b985fc788bb9ebefc7d8694d7': Fix the CAS login test (#826)
2 parents 5747b0b + bee7c32 commit de81a37

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

tests/12login/02cas.pl

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ sub wait_for_cas_request
161161
method => "GET",
162162
full_uri => $login_uri,
163163
max_redirects => 0, # don't follow the redirect
164-
)->followed_by( \&main::expect_http_302 ),
164+
),
165165
);
166166
})->then( sub {
167167
my ( $cas_validate_request, $ticket_response ) = @_;
@@ -175,19 +175,12 @@ sub wait_for_cas_request
175175
$HS_URI,
176176
"Service supplied to /cas/proxyValidate" );
177177

178-
my $redirect = $ticket_response->header( "Location" );
179-
log_if_fail( "Redirect from /login/cas/ticket", $redirect);
180-
assert_ok( $redirect =~ m#^https://client\?#,
181-
"Location returned by /login/cas/ticket did not match" );
182-
183-
# the original query param should have been preserved
184-
my $redirect_uri = URI->new($redirect);
185-
assert_eq( $redirect_uri->query_param( "p" ) // undef,
186-
"http://server",
187-
"Query param on redirect from /login/cas/ticket" );
178+
assert_ok( $ticket_response =~ "loginToken=([^\"&]+)",
179+
"Login token provided in the /ticket response" );
180+
my $login_token = $1;
188181

189-
# a 'loginToken' should be added.
190-
my $login_token = $redirect_uri->query_param( "loginToken" );
182+
log_if_fail( "Ticket response:", $ticket_response );
183+
log_if_fail( "Login token:", $login_token );
191184

192185
# step 7: the client uses the loginToken via the /login API.
193186
$http->do_request_json(

0 commit comments

Comments
 (0)