use of com.agiletec.aps.system.services.user.IAuthenticationProviderManager in project entando-core by entando.
the class BaseTestCase method getUser.
/**
* Return a user (with his autority) by username.
*
* @param username The username
* @param password The password
* @return The required user.
* @throws Exception In case of error.
*/
protected UserDetails getUser(String username, String password) throws Exception {
IAuthenticationProviderManager provider = (IAuthenticationProviderManager) this.getService(SystemConstants.AUTHENTICATION_PROVIDER_MANAGER);
IUserManager userManager = (IUserManager) this.getService(SystemConstants.USER_MANAGER);
UserDetails user = null;
if (username.equals(SystemConstants.GUEST_USER_NAME)) {
user = userManager.getGuestUser();
} else {
user = provider.getUser(username, password);
}
return user;
}
use of com.agiletec.aps.system.services.user.IAuthenticationProviderManager in project entando-core by entando.
the class ApsAdminBaseTestCase method getUser.
/**
* Return a user (with his autority) by username.
*
* @param username The username
* @param password The password
* @return The required user.
* @throws Exception In case of error.
*/
protected UserDetails getUser(String username, String password) throws Exception {
IAuthenticationProviderManager provider = (IAuthenticationProviderManager) this.getService(SystemConstants.AUTHENTICATION_PROVIDER_MANAGER);
IUserManager userManager = (IUserManager) this.getService(SystemConstants.USER_MANAGER);
UserDetails user = null;
if (username.equals(SystemConstants.GUEST_USER_NAME)) {
user = userManager.getGuestUser();
} else {
user = provider.getUser(username, password);
}
return user;
}
Aggregations