Skip to content
Snippets Groups Projects
Commit 39ec1e02 authored by William Enright's avatar William Enright Committed by Adrien Béraud
Browse files

Fixed logging in LDAP/AD with an existing user always triggering a failed user creation call

Change-Id: Ia5727968e6e0309fb1c5ef928da4b4d4ea29f0fc
parent 456f7a77
No related branches found
No related tags found
No related merge requests found
......@@ -142,6 +142,8 @@ public class UserAuthenticationModule implements AuthenticationModule {
statementList.addStatement(statementElement);
User user = datastore.getUserDao().getObjects(statementList).get(0);
if((user.getUserType() == AuthenticationSourceType.LOCAL)) hashPass = PasswordUtil.hashPassword(password, Base64.decodeBase64(user.getSalt()));
else hashPass = password;
if(hashPass != null && authenticationSources.get(new AuthModuleKey(user.getRealm(),user.getUserType()))
.authenticate(username,hashPass))
return tokenController.getToken(user,null);
......
......@@ -81,12 +81,11 @@ public class DeviceServlet extends HttpServlet {
statementList.addStatement(st1);
statementList.addStatement(st2);
Device device = dataStore.getDeviceDao().getObjects(statementList).get(0);
if(certificateAuthority.getLatestCRL().get() != null) {
if(certificateAuthority.getLatestCRL().get() != null)
device.setRevoked(certificateAuthority.getLatestCRL().get().getRevokedCertificate(device.getCertificate().getSerialNumber()) != null);
}
else{
else
device.setRevoked(false);
}
resp.getOutputStream().write(JsonStream.serialize(device).getBytes());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment