当前位置: 首页>>代码示例>>Java>>正文


Java Core.logout方法代码示例

本文整理汇总了Java中com.mendix.core.Core.logout方法的典型用法代码示例。如果您正苦于以下问题:Java Core.logout方法的具体用法?Java Core.logout怎么用?Java Core.logout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.mendix.core.Core的用法示例。


在下文中一共展示了Core.logout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: login

import com.mendix.core.Core; //导入方法依赖的package包/类
private void login(IMxRuntimeRequest req, IMxRuntimeResponse resp) throws Exception {
	String continuation = req.getParameter(CONTINUATION_PARAM);
	detectContinuationJsInjection(continuation);

	//special case 1: already a valid session, do not bother with a new login
	ISession session = this.getSessionFromRequest(req);
	if (session != null && !session.getUser().isAnonymous()) {

		//Logout old session and initialize new session. This will allow for role changes to take effect.
		String userId = session.getUser().getName();
		lockOpenID(userId);
		try {
			loginHandler.onCompleteLogin(userId, continuation, req, resp);
			Core.logout(session);
		} finally {
			unlockOpenID(userId);
		}
	} else if (!started) {
		//special case 2: no OpenID provider discovered
		LOG.warn("OpenId handler is in state 'NOT STARTED'. Falling back to default login.html");
		redirect(resp, FALLBACK_LOGINPAGE);
	} else {
		LOG.debug("Incoming login request, redirecting to OpenID provider");

		AuthRequest authReq = manager.authenticate(discovered, OPENID_RETURN_URL);
		authReq.setImmediate("true".equalsIgnoreCase(req.getParameter(IMMEDIATE_PARAM)));

		String url = authReq.getDestinationUrl(true);

		//MWE: publish the url which can be used to sign off
		if (SINGLESIGNOFF_ENABLED)
			url += "&mxid2.logoffcallback=" +  OpenIDUtils.urlEncode(OPENID_LOGOFF_URL);

		if (continuation != null)
			url += "&mxid2.continuation=" +  OpenIDUtils.urlEncode(continuation);

		redirect(resp, url);
	}
}
 
开发者ID:mendix,项目名称:IBM-Watson-Connector-Suite,代码行数:40,代码来源:OpenIDHandler.java

示例2: logoff

import com.mendix.core.Core; //导入方法依赖的package包/类
private void logoff(IMxRuntimeRequest req, IMxRuntimeResponse resp) throws CoreException {
	if (SINGLESIGNOFF_ENABLED) {
		resp.addCookie(getSessionCookieName(), "", "/", "", 0, true);
		resp.addCookie(SessionInitializer.XASID_COOKIE, "", "/", "", 0, true);
		resp.setStatus(IMxRuntimeResponse.SEE_OTHER);
		resp.addHeader("location", OPENID_PROVIDER + "/../" + LOGOFF);
	} else {
		ISession ses = this.getSessionFromRequest(req);
		if (ses != null) {
			Core.logout(ses);
		}
		redirect(resp, INDEX_PAGE);
	}
}
 
开发者ID:mendix,项目名称:IBM-Watson-Connector-Suite,代码行数:15,代码来源:OpenIDHandler.java

示例3: executeAction

import com.mendix.core.Core; //导入方法依赖的package包/类
@Override
public java.lang.Boolean executeAction() throws Exception
{
	// BEGIN USER CODE
       Collection<? extends ISession> activeSessions = Core.getActiveSessions();
       for (ISession session : activeSessions) {
           if(session.getUser() != null && session.getUser().getName().equals(openId)) {
               Core.logout(session);
           }
       }
       return true;
	// END USER CODE
}
 
开发者ID:mendix,项目名称:IBM-Watson-Connector-Suite,代码行数:14,代码来源:LogOutUser.java


注:本文中的com.mendix.core.Core.logout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。