--- a/jdk/test/sun/security/krb5/auto/Context.java Wed Nov 12 16:00:22 2008 +0800
+++ b/jdk/test/sun/security/krb5/auto/Context.java Wed Nov 12 16:01:06 2008 +0800
@@ -109,13 +109,22 @@
out.s = new Subject();
Krb5LoginModule krb5 = new Krb5LoginModule();
Map<String, String> map = new HashMap<String, String>();
- map.put("tryFirstPass", "true");
+ Map<String, Object> shared = new HashMap<String, Object>();
+
+ if (pass != null) {
+ map.put("useFirstPass", "true");
+ shared.put("javax.security.auth.login.name", user);
+ shared.put("javax.security.auth.login.password", pass);
+ } else {
+ map.put("doNotPrompt", "true");
+ map.put("useTicketCache", "true");
+ if (user != null) {
+ map.put("principal", user);
+ }
+ }
if (storeKey) {
map.put("storeKey", "true");
}
- Map<String, Object> shared = new HashMap<String, Object>();
- shared.put("javax.security.auth.login.name", user);
- shared.put("javax.security.auth.login.password", pass);
krb5.initialize(out.s, null, shared, map);
krb5.login();