Search in sources :

Example 6 with LogoutAction

use of org.apereo.cas.web.flow.logout.LogoutAction in project cas by apereo.

the class LogoutActionTests method logoutForServiceWithFollowRedirectsNoAllowedService.

@Test
public void logoutForServiceWithFollowRedirectsNoAllowedService() throws Exception {
    this.request.addParameter(CasProtocolConstants.PARAMETER_SERVICE, TEST_SERVICE_ID);
    final RegexRegisteredService impl = new RegexRegisteredService();
    impl.setServiceId("http://FooBar");
    impl.setName("FooBar");
    this.serviceManager.save(impl);
    final LogoutProperties properties = new LogoutProperties();
    this.logoutAction = new LogoutAction(getWebApplicationServiceFactory(), this.serviceManager, properties);
    final Event event = this.logoutAction.doExecute(this.requestContext);
    assertEquals(CasWebflowConstants.TRANSITION_ID_FINISH, event.getId());
    assertNull(this.requestContext.getFlowScope().get("logoutRedirectUrl"));
}
Also used : LogoutProperties(org.apereo.cas.configuration.model.core.logout.LogoutProperties) LogoutAction(org.apereo.cas.web.flow.logout.LogoutAction) Event(org.springframework.webflow.execution.Event) RegexRegisteredService(org.apereo.cas.services.RegexRegisteredService) Test(org.junit.Test)

Example 7 with LogoutAction

use of org.apereo.cas.web.flow.logout.LogoutAction in project cas by apereo.

the class LogoutActionTests method verifyLogoutCookie.

@Test
public void verifyLogoutCookie() throws Exception {
    final Cookie cookie = new Cookie(COOKIE_TGC_ID, "test");
    this.request.setCookies(cookie);
    final LogoutProperties properties = new LogoutProperties();
    this.logoutAction = new LogoutAction(getWebApplicationServiceFactory(), this.serviceManager, properties);
    final Event event = this.logoutAction.doExecute(this.requestContext);
    assertEquals(CasWebflowConstants.TRANSITION_ID_FINISH, event.getId());
}
Also used : Cookie(javax.servlet.http.Cookie) LogoutProperties(org.apereo.cas.configuration.model.core.logout.LogoutProperties) LogoutAction(org.apereo.cas.web.flow.logout.LogoutAction) Event(org.springframework.webflow.execution.Event) Test(org.junit.Test)

Aggregations

LogoutProperties (org.apereo.cas.configuration.model.core.logout.LogoutProperties)7 LogoutAction (org.apereo.cas.web.flow.logout.LogoutAction)7 Test (org.junit.Test)7 Event (org.springframework.webflow.execution.Event)7 Cookie (javax.servlet.http.Cookie)3 DefaultLogoutRequest (org.apereo.cas.logout.DefaultLogoutRequest)2 LogoutRequest (org.apereo.cas.logout.LogoutRequest)2 RegexRegisteredService (org.apereo.cas.services.RegexRegisteredService)2