Class AuthenticationServiceImpl
- java.lang.Object
-
- org.craftercms.profile.services.impl.AuthenticationServiceImpl
-
- All Implemented Interfaces:
AuthenticationService
public class AuthenticationServiceImpl extends Object implements AuthenticationService
Default implementation ofAuthenticationService
.- Author:
- avasquez
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AuthenticationServiceImpl()
-
Method Summary
-
-
-
Field Detail
-
LOG_KEY_AUTHENTICATION_SUCCESSFUL
public static final String LOG_KEY_AUTHENTICATION_SUCCESSFUL
- See Also:
- Constant Field Values
-
LOG_KEY_TICKET_CREATED
public static final String LOG_KEY_TICKET_CREATED
- See Also:
- Constant Field Values
-
LOG_KEY_TICKET_REQUESTED
public static final String LOG_KEY_TICKET_REQUESTED
- See Also:
- Constant Field Values
-
LOG_KEY_TICKET_INVALIDATED
public static final String LOG_KEY_TICKET_INVALIDATED
- See Also:
- Constant Field Values
-
LOG_KEY_PERSISTENT_LOGIN_CREATED
public static final String LOG_KEY_PERSISTENT_LOGIN_CREATED
- See Also:
- Constant Field Values
-
LOG_KEY_PERSISTENT_LOGIN_TOKEN_REFRESHED
public static final String LOG_KEY_PERSISTENT_LOGIN_TOKEN_REFRESHED
- See Also:
- Constant Field Values
-
LOG_KEY_PERSISTENT_LOGIN_DELETED
public static final String LOG_KEY_PERSISTENT_LOGIN_DELETED
- See Also:
- Constant Field Values
-
ERROR_KEY_CREATE_TICKET_ERROR
public static final String ERROR_KEY_CREATE_TICKET_ERROR
- See Also:
- Constant Field Values
-
ERROR_KEY_GET_TICKET_ERROR
public static final String ERROR_KEY_GET_TICKET_ERROR
- See Also:
- Constant Field Values
-
ERROR_KEY_UPDATE_TICKET_ERROR
public static final String ERROR_KEY_UPDATE_TICKET_ERROR
- See Also:
- Constant Field Values
-
ERROR_KEY_DELETE_TICKET_ERROR
public static final String ERROR_KEY_DELETE_TICKET_ERROR
- See Also:
- Constant Field Values
-
ERROR_KEY_CREATE_PERSISTENT_LOGIN_ERROR
public static final String ERROR_KEY_CREATE_PERSISTENT_LOGIN_ERROR
- See Also:
- Constant Field Values
-
ERROR_KEY_GET_PERSISTENT_LOGIN_ERROR
public static final String ERROR_KEY_GET_PERSISTENT_LOGIN_ERROR
- See Also:
- Constant Field Values
-
ERROR_KEY_UPDATE_PERSISTENT_LOGIN_ERROR
public static final String ERROR_KEY_UPDATE_PERSISTENT_LOGIN_ERROR
- See Also:
- Constant Field Values
-
ERROR_KEY_DELETE_PERSISTENT_LOGIN_ERROR
public static final String ERROR_KEY_DELETE_PERSISTENT_LOGIN_ERROR
- See Also:
- Constant Field Values
-
ERROR_KEY_WAIT_IS_ABORTED
public static final String ERROR_KEY_WAIT_IS_ABORTED
- See Also:
- Constant Field Values
-
permissionEvaluator
protected org.craftercms.commons.security.permissions.PermissionEvaluator<AccessToken,String> permissionEvaluator
-
ticketRepository
protected TicketRepository ticketRepository
-
persistentLoginRepository
protected PersistentLoginRepository persistentLoginRepository
-
profileService
protected ProfileService profileService
-
lockTime
protected int lockTime
-
failedLoginAttemptsBeforeLock
protected int failedLoginAttemptsBeforeLock
-
failedLoginAttemptsBeforeDelay
protected int failedLoginAttemptsBeforeDelay
-
-
Method Detail
-
setPermissionEvaluator
public void setPermissionEvaluator(org.craftercms.commons.security.permissions.PermissionEvaluator<AccessToken,String> permissionEvaluator)
-
setTicketRepository
public void setTicketRepository(TicketRepository ticketRepository)
-
setPersistentLoginRepository
public void setPersistentLoginRepository(PersistentLoginRepository persistentLoginRepository)
-
setProfileService
public void setProfileService(ProfileService profileService)
-
authenticate
public Ticket authenticate(String tenantName, String username, String password) throws ProfileException
- Specified by:
authenticate
in interfaceAuthenticationService
- Throws:
ProfileException
-
countAsFail
protected void countAsFail(Profile profile) throws ProfileException
- Throws:
ProfileException
-
isProfileInTimeOut
protected boolean isProfileInTimeOut(Profile profile)
-
createTicket
public Ticket createTicket(String profileId) throws ProfileException
- Specified by:
createTicket
in interfaceAuthenticationService
- Throws:
ProfileException
-
getTicket
public Ticket getTicket(String ticketId) throws ProfileException
- Specified by:
getTicket
in interfaceAuthenticationService
- Throws:
ProfileException
-
invalidateTicket
public void invalidateTicket(String ticketId) throws ProfileException
- Specified by:
invalidateTicket
in interfaceAuthenticationService
- Throws:
ProfileException
-
createPersistentLogin
public PersistentLogin createPersistentLogin(String profileId) throws ProfileException
- Specified by:
createPersistentLogin
in interfaceAuthenticationService
- Throws:
ProfileException
-
getPersistentLogin
public PersistentLogin getPersistentLogin(String loginId) throws ProfileException
- Specified by:
getPersistentLogin
in interfaceAuthenticationService
- Throws:
ProfileException
-
refreshPersistentLoginToken
public PersistentLogin refreshPersistentLoginToken(String loginId) throws ProfileException
- Specified by:
refreshPersistentLoginToken
in interfaceAuthenticationService
- Throws:
ProfileException
-
deletePersistentLogin
public void deletePersistentLogin(String loginId) throws ProfileException
- Specified by:
deletePersistentLogin
in interfaceAuthenticationService
- Throws:
ProfileException
-
checkIfManageTicketsIsAllowed
protected void checkIfManageTicketsIsAllowed(String tenantName)
-
setLockTime
public void setLockTime(int lockTime)
-
setFailedLoginAttemptsBeforeLock
public void setFailedLoginAttemptsBeforeLock(int failedLoginAttemptsBeforeLock)
-
setFailedLoginAttemptsBeforeDelay
public void setFailedLoginAttemptsBeforeDelay(int failedLoginAttemptsBeforeDelay)
-
-