Skip to content

Commit

Permalink
fox for changes in the security layer
Browse files Browse the repository at this point in the history
  • Loading branch information
mbuckton committed Jan 13, 2024
1 parent 9e4d30a commit d3e5c26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import io.mapsmessaging.security.identity.GroupEntry;
import io.mapsmessaging.security.identity.IdentityEntry;
import io.mapsmessaging.security.identity.parsers.PasswordParser;
import io.mapsmessaging.security.identity.parsers.sha.Sha512PasswordParser;
import io.mapsmessaging.security.identity.parsers.sha.UnixSha512PasswordParser;
import io.mapsmessaging.utilities.configuration.ConfigurationProperties;
import lombok.Getter;
import org.mapdb.DB;
Expand Down Expand Up @@ -75,7 +75,7 @@ public AuthenticationStorage(ConfigurationProperties config) {
String authProvider = config.getProperty("identityProvider", "Apache-Basic-Auth");

identityAccessManager = new IdentityAccessManager(authProvider, Map.of("configDirectory", securityDirectory), new IdDbStore<>(userMapSet), new IdDbStore<>(groupMapSet));
globalPasswordParser = new Sha512PasswordParser();
globalPasswordParser = new UnixSha512PasswordParser();
userPermisionManager = new UserPermisionManager(sessionPrivilegesMap);
}

Expand Down Expand Up @@ -117,7 +117,7 @@ public boolean validateUser(String username, String password) {
IdentityEntry identityEntry = identityAccessManager.getUserIdentity(username);
if (identityEntry != null) {
PasswordParser passwordParser = identityEntry.getPasswordParser();
byte[] hash = passwordParser.computeHash(password.getBytes(), passwordParser.getSalt(), passwordParser.getCost());
byte[] hash = passwordParser.transformPassword(password.getBytes(), passwordParser.getSalt(), passwordParser.getCost());
return Arrays.equals(hash, identityEntry.getPassword().getBytes());
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/NetworkManager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ NetworkManager:
url: tcp://:::5672/
protocol: amqp
sasl:
mechanism: "CRAM-MD5"
mechanism: "PLAIN"
identityProvider: system
map: "/{{virtualHostName}}"
virtualHost:
Expand Down

0 comments on commit d3e5c26

Please sign in to comment.