當前位置: 首頁>>代碼示例>>Java>>正文


Java WPBAuthenticationResult類代碼示例

本文整理匯總了Java中com.webpagebytes.cms.WPBAuthenticationResult的典型用法代碼示例。如果您正苦於以下問題:Java WPBAuthenticationResult類的具體用法?Java WPBAuthenticationResult怎麽用?Java WPBAuthenticationResult使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WPBAuthenticationResult類屬於com.webpagebytes.cms包,在下文中一共展示了WPBAuthenticationResult類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: checkAuthentication

import com.webpagebytes.cms.WPBAuthenticationResult; //導入依賴的package包/類
@Override
public WPBAuthenticationResult checkAuthentication(
		HttpServletRequest request) throws WPBIOException {		
	WPBDefaultAuthenticationResult result = new WPBDefaultAuthenticationResult();
	result.setLoginLink(loginPageUrl);
	result.setLogoutLink(logoutPageUrl);
	result.setUserProfileLink(profilePageUrl);
	try
	{
		GitkitUser gitkitUser = gitkitClient.validateTokenInRequest(request);
		if (null != gitkitUser && adminEmails.contains(gitkitUser.getEmail()))
		{
			result.setUserIdentifier(gitkitUser.getEmail());
		}
	} catch (GitkitClientException e)
	{
		// we will consider the user as not authenticated
	}

	return result;
}
 
開發者ID:webpagebytes,項目名稱:gitkit-auth-cms-plugins,代碼行數:22,代碼來源:WPBGitkitAuthentication.java

示例2: checkAuthentication

import com.webpagebytes.cms.WPBAuthenticationResult; //導入依賴的package包/類
public WPBAuthenticationResult checkAuthentication(HttpServletRequest request) throws WPBIOException
{
	// this authentication takes the token as base64, decodes it and verifies if it's a file, if yes then the filename 
	//is the userIdentifier 
	WPBDefaultAuthenticationResult result = new WPBDefaultAuthenticationResult();
	result.setLoginLink(loginPageUrl);
	result.setLogoutLink(logoutPageUrl);
	result.setUserProfileLink(profilePageUrl);
	
	String token = getTokenCookie(request);
	if (token == null) return result;
	String path = new String(CmsBase64Utility.fromSafePathBase64(token));
	File file = new File(path);
	if (file.exists())
	{
		result.setUserIdentifier(file.getName());
	}		
	return result;
}
 
開發者ID:webpagebytes,項目名稱:general-cms-plugins,代碼行數:20,代碼來源:WPBLocalAuthentication.java


注:本文中的com.webpagebytes.cms.WPBAuthenticationResult類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。