001
014
015 package com.liferay.portal.security.auth;
016
017 import com.liferay.portal.kernel.spring.osgi.OSGiBeanProperties;
018 import com.liferay.portal.service.UserLocalServiceUtil;
019
020 import java.util.Map;
021
022
026 @OSGiBeanProperties(property = "key=auth.failure")
027 public class LoginFailure implements AuthFailure {
028
029 @Override
030 public void onFailureByEmailAddress(
031 long companyId, String emailAddress,
032 Map<String, String[]> headerMap, Map<String, String[]> parameterMap)
033 throws AuthException {
034
035 try {
036 UserLocalServiceUtil.checkLoginFailureByEmailAddress(
037 companyId, emailAddress);
038 }
039 catch (Exception e) {
040 throw new AuthException(e);
041 }
042 }
043
044 @Override
045 public void onFailureByScreenName(
046 long companyId, String screenName, Map<String, String[]> headerMap,
047 Map<String, String[]> parameterMap)
048 throws AuthException {
049
050 try {
051 UserLocalServiceUtil.checkLoginFailureByScreenName(
052 companyId, screenName);
053 }
054 catch (Exception e) {
055 throw new AuthException(e);
056 }
057 }
058
059 @Override
060 public void onFailureByUserId(
061 long companyId, long userId, Map<String, String[]> headerMap,
062 Map<String, String[]> parameterMap)
063 throws AuthException {
064
065 try {
066 UserLocalServiceUtil.checkLoginFailureById(userId);
067 }
068 catch (Exception e) {
069 throw new AuthException(e);
070 }
071 }
072
073 }