@Test public void testSha1Hash() { String password = "admin123"; String sha1Hash = "f865b53623b121fd34ee5426c792e5c33af8c227"; assertThat(underTest.passwordsMatch(password, sha1Hash), is(true)); }
@Override public boolean passwordsMatch(final Object submittedPlaintext, final String encrypted) { return passwordService.passwordsMatch(submittedPlaintext, encrypted) || legacyPasswordService.passwordsMatch(submittedPlaintext, encrypted); }
DefaultSecurityPasswordService implements HashingPasswordService { @Override public boolean passwordsMatch(final Object submittedPlaintext, final String encrypted) { return passwordService.passwordsMatch(submittedPlaintext, encrypted) || legacyPasswordService.passwordsMatch(submittedPlaintext, encrypted); } }
DefaultSecurityPasswordService implements HashingPasswordService { @Override public boolean passwordsMatch(final Object submittedPlaintext, final String encrypted) { return passwordService.passwordsMatch(submittedPlaintext, encrypted) || legacyPasswordService.passwordsMatch(submittedPlaintext, encrypted); } @Inject  DefaultSecurityPasswordService(@Named("legacy") final PasswordService legacyPasswordService); }
DefaultSecurityPasswordService implements HashingPasswordService { @Override public boolean passwordsMatch(final Object submittedPlaintext, final String encrypted) { return passwordService.passwordsMatch(submittedPlaintext, encrypted) || legacyPasswordService.passwordsMatch(submittedPlaintext, encrypted); } @Inject  DefaultSecurityPasswordService(@Named("legacy") final PasswordService legacyPasswordService); @Override String encryptPassword(final Object plaintextPassword); @Override boolean passwordsMatch(final Object submittedPlaintext, final String encrypted); @Override Hash hashPassword(final Object plaintext); @Override boolean passwordsMatch(final Object plaintext, final Hash savedPasswordHash); }
DefaultSecurityPasswordService implements HashingPasswordService { @Override public boolean passwordsMatch(final Object submittedPlaintext, final String encrypted) { return passwordService.passwordsMatch(submittedPlaintext, encrypted) || legacyPasswordService.passwordsMatch(submittedPlaintext, encrypted); } @Inject  DefaultSecurityPasswordService(@Named("legacy") final PasswordService legacyPasswordService); @Override String encryptPassword(final Object plaintextPassword); @Override boolean passwordsMatch(final Object submittedPlaintext, final String encrypted); @Override Hash hashPassword(final Object plaintext); @Override boolean passwordsMatch(final Object plaintext, final Hash savedPasswordHash);  }