OneKDC kdc = new OneKDC(null).writeJAASConf();
kdc.addPrincipal("u1", "password".toCharArray(), "this_is_my_salt", null);
// Using password works
Context.fromUserPass("u1", "password".toCharArray(), true);
// Using KDC's keytab works
kdc.writeKtab("ktab0");
Context.fromUserKtabAsClient("u1", "ktab0", true);
// Self-created keytab with default salt does not work
ktab("-a u1 password -k ktab1");
Utils.runAndCheckException(
() -> Context.fromUserKtabAsClient("u1", "ktab1", true),
LoginException.class);
// Self-creating keytab with specified salt works
ktab("-a u1 password -s this_is_my_salt -k ktab2");
Context.fromUserKtabAsClient("u1", "ktab2", true);
// Self-creating keytab with salt from KDC works
ktab("-a u1 password -f -k ktab3");
Context.fromUserKtabAsClient("u1", "ktab3", true);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.