public class DefaultAuthenticationService extends AbstractBusinessService implements AuthenticationService
UserManagerAbstractService.SerializableDTO| Modifier and Type | Field and Description |
|---|---|
static String |
LOGIN_ANONYMOUS_ALWAYS_DISABLED
Configuration constant for
login.anonymous.always.disabled/ |
modelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultAuthenticationService() |
| Modifier and Type | Method and Description |
|---|---|
protected InvalidCredentialsException |
buildInvalidCredentialsException()
for security reasons we should throw same exception for both cases:
user not found
password does not match You can overwrite this method and adapt the exception and/or test that should be
thrown in this case
|
protected InvalidCredentialsException |
buildInvalidCredentialsException(String message) |
UserModel |
checkCredentials(String login,
String password)
check credentials.
|
UserModel |
login(String login,
String password)
login the user identified with login and password.
|
void |
logout()
log out the current user.
|
void |
setPasswordEncoderService(PasswordEncoderService passwordEncoderService) |
void |
setUserService(UserService userService) |
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, setTenantScope, writeReplacepublic static final String LOGIN_ANONYMOUS_ALWAYS_DISABLED
login.anonymous.always.disabled/ which allows changing the (default)
disabling of the anonymous account.public UserModel login(String login, String password) throws InvalidCredentialsException
AuthenticationServicelogin in interface AuthenticationServicelogin - the loginpassword - the passwordInvalidCredentialsException - if username/login does not matchpublic UserModel checkCredentials(String login, String password) throws InvalidCredentialsException
AuthenticationServicecheckCredentials in interface AuthenticationServicelogin - the loginpassword - the passwordInvalidCredentialsException - if username/login does not matchpublic void logout()
AuthenticationServicelogout in interface AuthenticationServiceprotected InvalidCredentialsException buildInvalidCredentialsException()
protected InvalidCredentialsException buildInvalidCredentialsException(String message)
public void setUserService(UserService userService)
public void setPasswordEncoderService(PasswordEncoderService passwordEncoderService)
Copyright © 2017 SAP SE. All Rights Reserved.