|
@@ -17,7 +17,6 @@
|
|
package org.springframework.security.oauth2.client.oidc.web.logout;
|
|
package org.springframework.security.oauth2.client.oidc.web.logout;
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
-import java.net.URI;
|
|
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
|
|
|
|
import jakarta.servlet.ServletException;
|
|
import jakarta.servlet.ServletException;
|
|
@@ -111,17 +110,6 @@ public class OidcClientInitiatedLogoutSuccessHandlerTests {
|
|
assertThat(this.response.getRedirectedUrl()).isEqualTo("https://default");
|
|
assertThat(this.response.getRedirectedUrl()).isEqualTo("https://default");
|
|
}
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
|
- public void logoutWhenUsingPostLogoutRedirectUriThenIncludesItInRedirect() throws IOException, ServletException {
|
|
|
|
- OAuth2AuthenticationToken token = new OAuth2AuthenticationToken(TestOidcUsers.create(),
|
|
|
|
- AuthorityUtils.NO_AUTHORITIES, this.registration.getRegistrationId());
|
|
|
|
- this.handler.setPostLogoutRedirectUri(URI.create("https://postlogout?encodedparam=value"));
|
|
|
|
- this.request.setUserPrincipal(token);
|
|
|
|
- this.handler.onLogoutSuccess(this.request, this.response, token);
|
|
|
|
- assertThat(this.response.getRedirectedUrl()).isEqualTo("https://endpoint?" + "id_token_hint=id-token&"
|
|
|
|
- + "post_logout_redirect_uri=https://postlogout?encodedparam%3Dvalue");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Test
|
|
@Test
|
|
public void logoutWhenUsingPostLogoutBaseUrlRedirectUriTemplateThenBuildsItForRedirect()
|
|
public void logoutWhenUsingPostLogoutBaseUrlRedirectUriTemplateThenBuildsItForRedirect()
|
|
throws IOException, ServletException {
|
|
throws IOException, ServletException {
|
|
@@ -196,11 +184,6 @@ public class OidcClientInitiatedLogoutSuccessHandlerTests {
|
|
+ "post_logout_redirect_uri=https://rp.example.org/context?forwardUrl%3Dsecured%253Fparam%253Dtrue");
|
|
+ "post_logout_redirect_uri=https://rp.example.org/context?forwardUrl%3Dsecured%253Fparam%253Dtrue");
|
|
}
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
|
- public void setPostLogoutRedirectUriWhenGivenNullThenThrowsException() {
|
|
|
|
- assertThatIllegalArgumentException().isThrownBy(() -> this.handler.setPostLogoutRedirectUri((URI) null));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Test
|
|
@Test
|
|
public void setPostLogoutRedirectUriTemplateWhenGivenNullThenThrowsException() {
|
|
public void setPostLogoutRedirectUriTemplateWhenGivenNullThenThrowsException() {
|
|
assertThatIllegalArgumentException().isThrownBy(() -> this.handler.setPostLogoutRedirectUri((String) null));
|
|
assertThatIllegalArgumentException().isThrownBy(() -> this.handler.setPostLogoutRedirectUri((String) null));
|