use of com.pogeyan.cmis.api.auth.IAuthService in project copper-cms by PogeyanOSS.
the class LoginActor method authenticate.
private LoginResponse authenticate(LoginRequest t, HashMap<String, Object> baggage) {
LoginResponse response = new LoginResponse();
try {
Map<String, String> loginSettings = RepositoryManagerFactory.getLoginDetails(t.getRepositoryId());
if (LOG.isDebugEnabled()) {
LOG.debug("Login settings for repositoryId: {}", loginSettings.toString());
}
IAuthService authService = LoginAuthServiceFactory.createAuthService(loginSettings);
if (authService != null) {
LoginRequestObject loginObject = new LoginRequestObject(t.getHeaders().get("authorization"), t.getRepositoryId());
IUserObject result = authService.authenticate(loginObject);
response.setSuccessfulLogin(result != null);
response.setLoginDetails(result);
} else {
LOG.error("Login authenticate service not found for: {}", loginSettings.toString());
response.setSuccessfulLogin(false);
}
} catch (Exception e) {
LOG.error("Login authenticate error: {}", ExceptionUtils.getStackTrace(e));
response.setSuccessfulLogin(false);
}
return response;
}
Aggregations