/** * @param name * @return */ public static ApplicationAuthenticator getAppAuthenticatorByName(String name) { for (ApplicationAuthenticator authenticator : FrameworkServiceComponent.getAuthenticators()) { if (name.equals(authenticator.getName())) { return authenticator; } } return null; }
/** * @param request * @return */ public static AuthenticationContext getContextData(HttpServletRequest request) { AuthenticationContext context = null; for (ApplicationAuthenticator authenticator : FrameworkServiceComponent.getAuthenticators()) { try { String contextIdentifier = authenticator.getContextIdentifier(request); if (contextIdentifier != null && !contextIdentifier.isEmpty()) { context = FrameworkUtils.getAuthenticationContextFromCache(contextIdentifier); if (context != null) { break; } } } catch (UnsupportedOperationException e) { if (log.isDebugEnabled()) { log.debug("Ignore UnsupportedOperationException.", e); } continue; } } return context; }