*
* ============LICENSE_END============================================
*
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ *
*/
package org.onap.portalapp.authentication;
import org.springframework.web.servlet.ModelAndView;
public class OpenIdConnectLoginStrategy extends org.onap.portalsdk.core.auth.LoginStrategy implements org.onap.portalapp.authentication.LoginStrategy {
-
- private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(OpenIdConnectLoginStrategy.class);
-
+ private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(OpenIdConnectLoginStrategy.class);
private static final String GLOBAL_LOCATION_KEY = "Location";
- @SuppressWarnings("rawtypes")
public boolean login(HttpServletRequest request, HttpServletResponse response) throws Exception{
logger.info("Attempting Login");
user.setLastName(userInfo.getFamilyName());
//store the currently logged in user's information in the session
- EPUserUtils.setUserSession(request, user, new HashSet(), new HashSet(), SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM),null);
+ EPUserUtils.setUserSession(request, user, new HashSet(), new HashSet(),null);
logger.info(EELFLoggerDelegate.errorLogger, request.getContextPath());
SessionCookieUtil.preSetUp(request, response);
String loginUrl = SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL);
logger.info(EELFLoggerDelegate.errorLogger, "Authentication Mechanism: '" + authentication + "'.");
- if (authentication == null || authentication.equals("") || authentication.trim().equals("OIDC")) {
+ if (authentication == null || "".equals(authentication) || "OIDC".equals(authentication.trim())) {
response.sendRedirect("oid-login");
} else {
logger.info(EELFLoggerDelegate.errorLogger, "No cookies are found, redirecting the request to '" + loginUrl + "'.");
}
@Override
- public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws PortalAPIException {
String message = "Method not implmented; Cannot be called";
logger.error(EELFLoggerDelegate.errorLogger, message);
- throw new Exception(message);
+ throw new PortalAPIException(message);
}
@Override