/** * Get tgs principal. * @return The tgs principal */ public String getTgsPrincipal() { return getString(KrbConfigKey.TGS_PRINCIPAL, true, LIBDEFAULT); }
/** * Get KDC host name * * @return The kdc host */ public String getKdcHost() { return getString( KrbConfigKey.KDC_HOST, true, LIBDEFAULT); }
/** * Get default realm. * @return The default realm */ public String getDefaultRealm() { return getString(KrbConfigKey.DEFAULT_REALM, true, LIBDEFAULT); }
/** * Get tgs principal. * @return The tgs principal */ public String getTgsPrincipal() { return getString(KrbConfigKey.TGS_PRINCIPAL, true, LIBDEFAULT); }
/** * Get default realm. * @return The default realm */ public String getDefaultRealm() { return getString(KrbConfigKey.DEFAULT_REALM, true, LIBDEFAULT); }
/** * Get KDC host name * * @return The kdc host */ public String getKdcHost() { return getString( KrbConfigKey.KDC_HOST, true, LIBDEFAULT); }
public String getPkinitKdcHostName() { return getString( KrbConfigKey.PKINIT_KDC_HOSTNAME, true, LIBDEFAULT); }
public String getPkinitKdcHostName() { return getString( KrbConfigKey.PKINIT_KDC_HOSTNAME, true, LIBDEFAULT); }
/** * Get KDC realm. * @return The kdc realm */ public String getKdcRealm() { String realm = getString(KrbConfigKey.KDC_REALM, false, LIBDEFAULT); if (realm == null) { realm = getString(KrbConfigKey.DEFAULT_REALM, false, LIBDEFAULT); if (realm == null) { realm = (String) KrbConfigKey.KDC_REALM.getDefaultValue(); } } return realm; }
/** * Get KDC realm. * @return The kdc realm */ public String getKdcRealm() { String realm = getString(KrbConfigKey.KDC_REALM, false, LIBDEFAULT); if (realm == null) { realm = getString(KrbConfigKey.DEFAULT_REALM, false, LIBDEFAULT); if (realm == null) { realm = (String) KrbConfigKey.KDC_REALM.getDefaultValue(); } } return realm; }
/** * Get renew life time. * @return The renew life time */ public String getRenewLifetime() { try { return Long.toString(getLong(KrbConfigKey.RENEW_LIFETIME, true, LIBDEFAULT)); } catch (Exception e) { return getString(KrbConfigKey.RENEW_LIFETIME, true, LIBDEFAULT); } }
/** * Get ticket life time. * @return The ticket life time */ public String getTicketLifetime() { try { return Long.toString(getLong(KrbConfigKey.TICKET_LIFETIME, true, LIBDEFAULT)); } catch (Exception e) { return getString(KrbConfigKey.TICKET_LIFETIME, true, LIBDEFAULT); } }
/** * Get ticket life time. * @return The ticket life time */ public String getTicketLifetime() { try { return Long.toString(getLong(KrbConfigKey.TICKET_LIFETIME, true, LIBDEFAULT)); } catch (Exception e) { return getString(KrbConfigKey.TICKET_LIFETIME, true, LIBDEFAULT); } }
/** * Get renew life time. * @return The renew life time */ public String getRenewLifetime() { try { return Long.toString(getLong(KrbConfigKey.RENEW_LIFETIME, true, LIBDEFAULT)); } catch (Exception e) { return getString(KrbConfigKey.RENEW_LIFETIME, true, LIBDEFAULT); } }
final String ccacheNameConf = krbClient.getSetting().getKrbConfig().getString("default_ccache_name"); String ccacheName; if (ccacheNameEnv != null) {
final String ccacheNameConf = krbClient.getSetting().getKrbConfig().getString("default_ccache_name"); String ccacheName; if (ccacheNameEnv != null) {
try { KrbClient krbClient = new KrbClient(confDir); ccacheNameConf = krbClient.getSetting().getKrbConfig().getString("default_ccache_name"); } catch (KrbException e) { System.err.println("Create krbClient failed: " + e.getMessage());
try { KrbClient krbClient = new KrbClient(confDir); ccacheNameConf = krbClient.getSetting().getKrbConfig().getString("default_ccache_name"); } catch (KrbException e) { System.err.println("Create krbClient failed: " + e.getMessage());
private Keytab getKeytab() { File keytabFile = null; KOptions kOptions = getRequestOptions(); if (kOptions.contains(KrbOption.KEYTAB_FILE)) { keytabFile = kOptions.getFileOption(KrbOption.KEYTAB_FILE); } if (kOptions.contains(KrbOption.USE_DFT_KEYTAB)) { final String clientKeytabEnv = System.getenv("KRB5_CLIENT_KTNAME"); final String clientKeytabDft = getContext().getConfig().getString( "default_client_keytab_name"); if (clientKeytabEnv != null) { keytabFile = new File(clientKeytabEnv); } else if (clientKeytabDft != null) { keytabFile = new File(clientKeytabDft); } else { System.err.println("Default client keytab file not found."); } } Keytab keytab = null; try { keytab = Keytab.loadKeytab(keytabFile); } catch (IOException e) { System.err.println("Can not load keytab from file" + keytabFile.getAbsolutePath()); } return keytab; }
private Keytab getKeytab() { File keytabFile = null; KOptions kOptions = getRequestOptions(); if (kOptions.contains(KrbOption.KEYTAB_FILE)) { keytabFile = kOptions.getFileOption(KrbOption.KEYTAB_FILE); } if (kOptions.contains(KrbOption.USE_DFT_KEYTAB)) { final String clientKeytabEnv = System.getenv("KRB5_CLIENT_KTNAME"); final String clientKeytabDft = getContext().getConfig().getString( "default_client_keytab_name"); if (clientKeytabEnv != null) { keytabFile = new File(clientKeytabEnv); } else if (clientKeytabDft != null) { keytabFile = new File(clientKeytabDft); } else { System.err.println("Default client keytab file not found."); } } Keytab keytab = null; try { keytab = Keytab.loadKeytab(keytabFile); } catch (IOException e) { System.err.println("Can not load keytab from file" + keytabFile.getAbsolutePath()); } return keytab; }