67 lines
2.0 KiB
Java
67 lines
2.0 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package com.tridium.fox.kerberos;
|
|
|
|
import java.util.HashMap;
|
|
import javax.security.auth.login.AppConfigurationEntry;
|
|
import javax.security.auth.login.Configuration;
|
|
|
|
public class KerberosConfig
|
|
extends Configuration {
|
|
AppConfigurationEntry entry = null;
|
|
String principal = null;
|
|
boolean useTicketCache = false;
|
|
boolean doNotPrompt = false;
|
|
boolean isInitiator = true;
|
|
boolean storeKey = false;
|
|
|
|
public KerberosConfig(String string) {
|
|
this.principal = string;
|
|
this.init();
|
|
}
|
|
|
|
public KerberosConfig(boolean bl, boolean bl2) {
|
|
this.useTicketCache = bl;
|
|
this.doNotPrompt = bl2;
|
|
this.init();
|
|
}
|
|
|
|
public void setUseTicketCache(boolean bl) {
|
|
this.useTicketCache = bl;
|
|
this.init();
|
|
}
|
|
|
|
public void setDoNotPrompt(boolean bl) {
|
|
this.doNotPrompt = bl;
|
|
this.init();
|
|
}
|
|
|
|
public void setIsInitiator(boolean bl) {
|
|
this.isInitiator = bl;
|
|
if (!bl) {
|
|
this.storeKey = true;
|
|
}
|
|
this.init();
|
|
}
|
|
|
|
private void init() {
|
|
HashMap<String, String> hashMap = new HashMap<String, String>();
|
|
if (this.principal != null) {
|
|
hashMap.put("principal", this.principal);
|
|
}
|
|
hashMap.put("useTicketCache", Boolean.toString(this.useTicketCache));
|
|
hashMap.put("doNotPrompt", Boolean.toString(this.doNotPrompt));
|
|
hashMap.put("isInitiator", Boolean.toString(this.isInitiator));
|
|
hashMap.put("storeKey", Boolean.toString(this.storeKey));
|
|
hashMap.put("refreshKrb5Config", "true");
|
|
this.entry = new AppConfigurationEntry("com.sun.security.auth.module.Krb5LoginModule", AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, hashMap);
|
|
}
|
|
|
|
public AppConfigurationEntry[] getAppConfigurationEntry(String string) {
|
|
AppConfigurationEntry[] appConfigurationEntryArray = new AppConfigurationEntry[]{this.entry};
|
|
return appConfigurationEntryArray;
|
|
}
|
|
}
|
|
|