本文整理匯總了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;
}
示例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;
}