thanks. how do i test that my configuration is working correctly?
final String username = "username";
final String password = "password";
String hashedPasswordBase64 = new
Sha512Hash(password).toBase64();
// ini part.
Ini ini = new Ini();
Ini.Section main = ini.addSection("main");
main.put("credentialsMatcher",
"org.apache.shiro.authc.credential.Sha512CredentialsMatcher");
main.put("iniRealm.credentialsMatcher", "$credentialsMatcher");
main.put("credentialsMatcher.storedCredentialsHexEncoded", "false");
Ini.Section testUsers = ini.addSection(IniRealm.USERS_SECTION_NAME);
testUsers.put(username, hashedPasswordBase64);
IniSecurityManagerFactory factory = new
IniSecurityManagerFactory(ini);
SecurityManager sm = factory.createInstance();
//try to log-in:
Subject subject = new Subject.Builder(sm).buildSubject();
//ensure thread clean-up after the login method returns. Test cases
only:
subject.execute(new Runnable() {
public void run() {
SecurityUtils.getSubject().login(new
UsernamePasswordToken(username, password));
}
});
Assert.assertEquals(subject.getPrincipal(), username);
but i have no idea , how to test salt.
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/tapestry-security-with-1-1-0-of-shiro-unable-to-get-sha512-login-working-tp3263653p3264486.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]