FIXED MIFSOX-1237,MIFOSX-1238
This commit is contained in:
+6
-1
@@ -22,6 +22,7 @@ import org.mifosplatform.infrastructure.security.service.SpringSecurityPlatformS
|
||||
import org.mifosplatform.useradministration.data.RoleData;
|
||||
import org.mifosplatform.useradministration.domain.AppUser;
|
||||
import org.mifosplatform.useradministration.domain.Role;
|
||||
import org.mifosplatform.useradministration.exception.UserNotFoundException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
@@ -58,6 +59,10 @@ public class AuthenticationApiResource {
|
||||
|
||||
final Authentication authentication = new UsernamePasswordAuthenticationToken(username, password);
|
||||
final Authentication authenticationCheck = this.customAuthenticationProvider.authenticate(authentication);
|
||||
final AppUser principal = (AppUser) authenticationCheck.getPrincipal();
|
||||
if (principal.isDeleted() || principal.isNotEnabled() ) {
|
||||
throw new UserNotFoundException(principal.getId());
|
||||
}
|
||||
|
||||
final Collection<String> permissions = new ArrayList<String>();
|
||||
AuthenticatedUserData authenticatedUserData = new AuthenticatedUserData(username, permissions);
|
||||
@@ -67,7 +72,7 @@ public class AuthenticationApiResource {
|
||||
for (final GrantedAuthority grantedAuthority : authorities) {
|
||||
permissions.add(grantedAuthority.getAuthority());
|
||||
}
|
||||
final AppUser principal = (AppUser) authenticationCheck.getPrincipal();
|
||||
|
||||
final byte[] base64EncodedAuthenticationKey = Base64.encode(username + ":" + password);
|
||||
|
||||
final Collection<RoleData> roles = new ArrayList<RoleData>();
|
||||
|
||||
+4
@@ -544,4 +544,8 @@ public class AppUser extends AbstractPersistable<Long> implements PlatformUser {
|
||||
|
||||
return passwordEncodedValue;
|
||||
}
|
||||
|
||||
public boolean isNotEnabled() {
|
||||
return !isEnabled();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user