本文整理汇总了Java中org.jasig.cas.logout.DefaultLogoutRequest类的典型用法代码示例。如果您正苦于以下问题:Java DefaultLogoutRequest类的具体用法?Java DefaultLogoutRequest怎么用?Java DefaultLogoutRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultLogoutRequest类属于org.jasig.cas.logout包,在下文中一共展示了DefaultLogoutRequest类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: verifyLogoutOneLogoutRequestNotAttempted
import org.jasig.cas.logout.DefaultLogoutRequest; //导入依赖的package包/类
@Test
public void verifyLogoutOneLogoutRequestNotAttempted() throws Exception {
final SingleLogoutService service = new WebApplicationServiceFactory().createService(TEST_URL, SingleLogoutService.class);
final LogoutRequest logoutRequest = new DefaultLogoutRequest(TICKET_ID,
service,
new URL(TEST_URL));
final Event event = getLogoutEvent(Arrays.asList(logoutRequest));
assertEquals(FrontChannelLogoutAction.REDIRECT_APP_EVENT, event.getId());
final List<LogoutRequest> list = WebUtils.getLogoutRequests(this.requestContext);
assertEquals(1, list.size());
final String url = (String) event.getAttributes().get(FrontChannelLogoutAction.DEFAULT_FLOW_ATTRIBUTE_LOGOUT_URL);
assertTrue(url.startsWith(TEST_URL + '?' + FrontChannelLogoutAction.DEFAULT_LOGOUT_PARAMETER + '='));
final byte[] samlMessage = CompressionUtils.decodeBase64ToByteArray(
URLDecoder.decode(StringUtils.substringAfter(url, '?' + FrontChannelLogoutAction.DEFAULT_LOGOUT_PARAMETER + '='), "UTF-8"));
final Inflater decompresser = new Inflater();
decompresser.setInput(samlMessage);
final byte[] result = new byte[1000];
decompresser.inflate(result);
decompresser.end();
final String message = new String(result);
assertTrue(message.startsWith("<samlp:LogoutRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" ID=\""));
assertTrue(message.contains("<samlp:SessionIndex>" + TICKET_ID + "</samlp:SessionIndex>"));
}
示例2: verifyLogoutOneLogoutRequestNotAttempted
import org.jasig.cas.logout.DefaultLogoutRequest; //导入依赖的package包/类
@Test
public void verifyLogoutOneLogoutRequestNotAttempted() throws Exception {
final LogoutRequest logoutRequest = new DefaultLogoutRequest(TICKET_ID,
new SimpleWebApplicationServiceImpl(TEST_URL),
new URL(TEST_URL));
final Event event = getLogoutEvent(Arrays.asList(logoutRequest));
assertEquals(FrontChannelLogoutAction.REDIRECT_APP_EVENT, event.getId());
final List<LogoutRequest> list = WebUtils.getLogoutRequests(this.requestContext);
assertEquals(1, list.size());
final String url = (String) event.getAttributes().get(FrontChannelLogoutAction.DEFAULT_FLOW_ATTRIBUTE_LOGOUT_URL);
assertTrue(url.startsWith(TEST_URL + "?" + FrontChannelLogoutAction.DEFAULT_LOGOUT_PARAMETER + "="));
final byte[] samlMessage = CompressionUtils.decodeBase64ToByteArray(
URLDecoder.decode(StringUtils.substringAfter(url, "?" + FrontChannelLogoutAction.DEFAULT_LOGOUT_PARAMETER + "="), "UTF-8"));
final Inflater decompresser = new Inflater();
decompresser.setInput(samlMessage);
final byte[] result = new byte[1000];
decompresser.inflate(result);
decompresser.end();
final String message = new String(result);
assertTrue(message.startsWith("<samlp:LogoutRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" ID=\""));
assertTrue(message.contains("<samlp:SessionIndex>" + TICKET_ID + "</samlp:SessionIndex>"));
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:24,代码来源:FrontChannelLogoutActionTests.java
示例3: verifyLogoutOneLogoutRequestSuccess
import org.jasig.cas.logout.DefaultLogoutRequest; //导入依赖的package包/类
@Test
public void verifyLogoutOneLogoutRequestSuccess() throws Exception {
final DefaultLogoutRequest logoutRequest = new DefaultLogoutRequest("", null, null);
logoutRequest.setStatus(LogoutRequestStatus.SUCCESS);
WebUtils.putLogoutRequests(this.requestContext, Collections.<LogoutRequest>emptyList());
this.requestContext.getFlowScope().put(FrontChannelLogoutAction.LOGOUT_INDEX, 0);
final Event event = this.frontChannelLogoutAction.doExecute(this.requestContext);
assertEquals(FrontChannelLogoutAction.FINISH_EVENT, event.getId());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:10,代码来源:FrontChannelLogoutActionTests.java
示例4: verifyLogoutRequestBack
import org.jasig.cas.logout.DefaultLogoutRequest; //导入依赖的package包/类
@Test
public void verifyLogoutRequestBack() throws Exception {
final Cookie cookie = new Cookie(COOKIE_TGC_ID, "test");
this.request.setCookies(cookie);
final LogoutRequest logoutRequest = new DefaultLogoutRequest("", null, null);
logoutRequest.setStatus(LogoutRequestStatus.SUCCESS);
WebUtils.putLogoutRequests(this.requestContext, Arrays.asList(logoutRequest));
final Event event = this.logoutAction.doExecute(this.requestContext);
assertEquals(LogoutAction.FINISH_EVENT, event.getId());
}
示例5: verifyLogoutRequestFront
import org.jasig.cas.logout.DefaultLogoutRequest; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void verifyLogoutRequestFront() throws Exception {
final Cookie cookie = new Cookie(COOKIE_TGC_ID, "test");
this.request.setCookies(cookie);
final LogoutRequest logoutRequest = new DefaultLogoutRequest("", null, null);
WebUtils.putLogoutRequests(this.requestContext, Arrays.asList(logoutRequest));
final Event event = this.logoutAction.doExecute(this.requestContext);
assertEquals(LogoutAction.FRONT_EVENT, event.getId());
final List<LogoutRequest> logoutRequests = WebUtils.getLogoutRequests(this.requestContext);
assertEquals(1, logoutRequests.size());
assertEquals(logoutRequest, logoutRequests.get(0));
}