Skip to content

Commit

Permalink
backfill test: RP initiated logout
Browse files Browse the repository at this point in the history
- Add test coverage on the existing behavior described in
  #2589 where UAA attempts to
  log the user out of the external OIDC provider after a successful UAA
  logout (this is called the RP initiated logout)

[#184752215]
  • Loading branch information
peterhaochen47 committed Nov 6, 2023
1 parent b3bafef commit 677283f
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -181,6 +182,7 @@ public void setUp() throws Exception {
config.setTokenKeyUrl(new URL(urlBase + "/token_key"));
config.setIssuer(urlBase + "/oauth/token");
config.setUserInfoUrl(new URL(urlBase + "/userinfo"));
config.setLogoutUrl(new URL(urlBase + "/logout.do"));

config.setShowLinkText(true);
config.setLinkText("My OIDC Provider");
Expand Down Expand Up @@ -558,6 +560,14 @@ public void testResponseTypeRequired() {
assertThat(webDriver.getCurrentUrl(), containsString("error_description=Missing%20response_type%20in%20authorization%20request"));
}

@Test
public void successfulUaaLogoutTriggersExternalOIDCProviderLogout() {
validateSuccessfulOIDCLogin(zoneUrl, testAccounts.getUserName(), testAccounts.getPassword());

webDriver.get(baseUrl);
Assert.assertThat("URL validation failed", webDriver.getCurrentUrl(), endsWith("/login"));
}

private String getRefreshTokenResponse(ServerRunning serverRunning, String refreshToken) {
MultiValueMap<String, String> formData = new LinkedMultiValueMap<>();
formData.add("client_id", zoneClient.getClientId());
Expand Down

0 comments on commit 677283f

Please sign in to comment.