本文整理汇总了Java中org.jasig.cas.logout.LogoutRequestStatus类的典型用法代码示例。如果您正苦于以下问题:Java LogoutRequestStatus类的具体用法?Java LogoutRequestStatus怎么用?Java LogoutRequestStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LogoutRequestStatus类属于org.jasig.cas.logout包,在下文中一共展示了LogoutRequestStatus类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doInternalExecute
import org.jasig.cas.logout.LogoutRequestStatus; //导入依赖的package包/类
@Override
protected Event doInternalExecute(final HttpServletRequest request, final HttpServletResponse response,
final RequestContext context) throws Exception {
final List<LogoutRequest> logoutRequests = WebUtils.getLogoutRequests(context);
final Integer startIndex = getLogoutIndex(context);
if (logoutRequests != null) {
for (int i = startIndex; i < logoutRequests.size(); i++) {
final LogoutRequest logoutRequest = logoutRequests.get(i);
if (logoutRequest.getStatus() == LogoutRequestStatus.NOT_ATTEMPTED) {
// assume it has been successful
logoutRequest.setStatus(LogoutRequestStatus.SUCCESS);
// save updated index
putLogoutIndex(context, i + 1);
final String logoutUrl = logoutRequest.getLogoutUrl().toExternalForm();
LOGGER.debug("Using logout url [{}] for front-channel logout requests", logoutUrl);
final String logoutMessage = logoutManager.createFrontChannelLogoutMessage(logoutRequest);
LOGGER.debug("Front-channel logout message to send under [{}] is [{}]",
this.logoutRequestParameter, logoutMessage);
// redirect to application with SAML logout message
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(logoutUrl);
builder.queryParam(this.logoutRequestParameter, URLEncoder.encode(logoutMessage, "UTF-8"));
return result(REDIRECT_APP_EVENT, DEFAULT_FLOW_ATTRIBUTE_LOGOUT_URL, builder.build().toUriString());
}
}
}
// no new service with front-channel logout -> finish logout
return new Event(this, FINISH_EVENT);
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:36,代码来源:FrontChannelLogoutAction.java
示例2: doInternalExecute
import org.jasig.cas.logout.LogoutRequestStatus; //导入依赖的package包/类
@Override
protected Event doInternalExecute(final HttpServletRequest request, final HttpServletResponse response,
final RequestContext context) throws Exception {
boolean needFrontSlo = false;
putLogoutIndex(context, 0);
final List<LogoutRequest> logoutRequests = WebUtils.getLogoutRequests(context);
if (logoutRequests != null) {
for (final LogoutRequest logoutRequest : logoutRequests) {
// if some logout request must still be attempted
if (logoutRequest.getStatus() == LogoutRequestStatus.NOT_ATTEMPTED) {
needFrontSlo = true;
break;
}
}
}
final String service = request.getParameter(CasProtocolConstants.PARAMETER_SERVICE);
if (this.followServiceRedirects && service != null) {
final Service webAppService = new WebApplicationServiceFactory().createService(service);
final RegisteredService rService = this.servicesManager.findServiceBy(webAppService);
if (rService != null && rService.getAccessStrategy().isServiceAccessAllowed()) {
context.getFlowScope().put("logoutRedirectUrl", service);
}
}
// there are some front services to logout, perform front SLO
if (needFrontSlo) {
return new Event(this, FRONT_EVENT);
} else {
// otherwise, finish the logout process
return new Event(this, FINISH_EVENT);
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:36,代码来源:LogoutAction.java
示例3: verifyLogoutOneLogoutRequestSuccess
import org.jasig.cas.logout.LogoutRequestStatus; //导入依赖的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.LogoutRequestStatus; //导入依赖的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());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:11,代码来源:LogoutActionTests.java
示例5: doInternalExecute
import org.jasig.cas.logout.LogoutRequestStatus; //导入依赖的package包/类
@Override
protected Event doInternalExecute(final HttpServletRequest request, final HttpServletResponse response,
final RequestContext context) throws Exception {
boolean needFrontSlo = false;
putLogoutIndex(context, 0);
final List<LogoutRequest> logoutRequests = WebUtils.getLogoutRequests(context);
if (logoutRequests != null) {
for (final LogoutRequest logoutRequest : logoutRequests) {
// if some logout request must still be attempted
if (logoutRequest.getStatus() == LogoutRequestStatus.NOT_ATTEMPTED) {
needFrontSlo = true;
break;
}
}
}
final String service = request.getParameter("service");
if (this.followServiceRedirects && service != null) {
final Service webAppService = new SimpleWebApplicationServiceImpl(service);
final RegisteredService rService = this.servicesManager.findServiceBy(webAppService);
if (rService != null && rService.getAccessStrategy().isServiceAccessAllowed()) {
context.getFlowScope().put("logoutRedirectUrl", service);
}
}
// there are some front services to logout, perform front SLO
if (needFrontSlo) {
return new Event(this, FRONT_EVENT);
} else {
// otherwise, finish the logout process
return new Event(this, FINISH_EVENT);
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:36,代码来源:LogoutAction.java
示例6: doInternalExecute
import org.jasig.cas.logout.LogoutRequestStatus; //导入依赖的package包/类
@Override
protected Event doInternalExecute(final HttpServletRequest request, final HttpServletResponse response,
final RequestContext context) throws Exception {
final List<LogoutRequest> logoutRequests = WebUtils.getLogoutRequests(context);
final Integer startIndex = getLogoutIndex(context);
if (logoutRequests != null && startIndex != null) {
for (int i = startIndex; i < logoutRequests.size(); i++) {
final LogoutRequest logoutRequest = logoutRequests.get(i);
if (logoutRequest.getStatus() == LogoutRequestStatus.NOT_ATTEMPTED) {
// assume it has been successful
logoutRequest.setStatus(LogoutRequestStatus.SUCCESS);
// save updated index
putLogoutIndex(context, i + 1);
// redirect to application with SAML logout message
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(logoutRequest.getService().getId());
builder.queryParam("SAMLRequest",
URLEncoder.encode(logoutManager.createFrontChannelLogoutMessage(logoutRequest), "UTF-8"));
return result(REDIRECT_APP_EVENT, "logoutUrl", builder.build().toUriString());
}
}
}
// no new service with front-channel logout -> finish logout
return new Event(this, FINISH_EVENT);
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:29,代码来源:FrontChannelLogoutAction.java
示例7: doInternalExecute
import org.jasig.cas.logout.LogoutRequestStatus; //导入依赖的package包/类
@Override
protected Event doInternalExecute(final HttpServletRequest request, final HttpServletResponse response,
final RequestContext context) throws Exception {
boolean needFrontSlo = false;
putLogoutIndex(context, 0);
final List<LogoutRequest> logoutRequests = WebUtils.getLogoutRequests(context);
if (logoutRequests != null) {
for (LogoutRequest logoutRequest : logoutRequests) {
// if some logout request must still be attempted
if (logoutRequest.getStatus() == LogoutRequestStatus.NOT_ATTEMPTED) {
needFrontSlo = true;
break;
}
}
}
final String service = request.getParameter("service");
if (this.followServiceRedirects && service != null) {
final RegisteredService rService = this.servicesManager.findServiceBy(new SimpleWebApplicationServiceImpl(service));
if (rService != null && rService.isEnabled()) {
context.getFlowScope().put("logoutRedirectUrl", service);
}
}
// there are some front services to logout, perform front SLO
if (needFrontSlo) {
return new Event(this, FRONT_EVENT);
} else {
// otherwise, finish the logout process
return new Event(this, FINISH_EVENT);
}
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:35,代码来源:LogoutAction.java
示例8: testLogoutOneLogoutRequestSuccess
import org.jasig.cas.logout.LogoutRequestStatus; //导入依赖的package包/类
@Test
public void testLogoutOneLogoutRequestSuccess() throws Exception {
final LogoutRequest logoutRequest = new LogoutRequest("", 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:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:10,代码来源:FrontChannelLogoutActionTests.java
示例9: testLogoutRequestBack
import org.jasig.cas.logout.LogoutRequestStatus; //导入依赖的package包/类
@Test
public void testLogoutRequestBack() throws Exception {
final Cookie cookie = new Cookie(COOKIE_TGC_ID, "test");
this.request.setCookies(new Cookie[] {cookie});
LogoutRequest logoutRequest = new LogoutRequest("", 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());
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:11,代码来源:LogoutActionTests.java
注:本文中的org.jasig.cas.logout.LogoutRequestStatus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论