public static KrbClient newClient( String krb5ConfFilename ) throws IOException, KrbException { KrbConfig krbConfig = new KrbConfig(); if ( krb5ConfFilename != null ) { krbConfig.addKrb5Config( new File( krb5ConfFilename ) ); } KrbClient krbClient = new KrbClient( krbConfig ); krbClient.init(); return krbClient; }
if (confFile != null && confFile.exists()) { try { krbConfig.addKrb5Config(confFile); } catch (IOException e) { throw new KrbException("Failed to load krb config "
if (confFile != null && confFile.exists()) { try { krbConfig.addKrb5Config(confFile); } catch (IOException e) { throw new KrbException("Failed to load krb config "
/** * Load krb5.conf from specified conf dir. * @param conf The conf file or dir, default file name 'krb5.conf' is used if dir * @return KrbConfig * @throws KrbException e */ public static KrbConfig getConfig(File conf) throws KrbException { if (!conf.exists()) { throw new KrbException(conf + " not found"); } File confFile = conf.isDirectory() ? new File(conf, KRB5_FILE_NAME) : conf; if (!confFile.exists()) { throw new KrbException(KRB5_FILE_NAME + " not found"); } if (confFile != null && confFile.exists()) { KrbConfig krbConfig = new KrbConfig(); try { krbConfig.addKrb5Config(confFile); return krbConfig; } catch (IOException e) { throw new KrbException("Failed to load krb config " + confFile.getAbsolutePath()); } } return null; }
/** * Load krb5.conf from specified conf dir. * @param conf The conf file or dir, default file name 'krb5.conf' is used if dir * @return KrbConfig * @throws KrbException e */ public static KrbConfig getConfig(File conf) throws KrbException { if (!conf.exists()) { throw new KrbException(conf + " not found"); } File confFile = conf.isDirectory() ? new File(conf, KRB5_FILE_NAME) : conf; if (!confFile.exists()) { throw new KrbException(KRB5_FILE_NAME + " not found"); } if (confFile != null && confFile.exists()) { KrbConfig krbConfig = new KrbConfig(); try { krbConfig.addKrb5Config(confFile); return krbConfig; } catch (IOException e) { throw new KrbException("Failed to load krb config " + confFile.getAbsolutePath()); } } return null; }
File confFile = new File(System.getProperty("java.security.krb5.conf")); KrbConfig krbConfig = new KrbConfig(); krbConfig.addKrb5Config(confFile); krbClient = new KrbClient(krbConfig); krbClient.init();
File confFile = new File(System.getProperty("java.security.krb5.conf")); KrbConfig krbConfig = new KrbConfig(); krbConfig.addKrb5Config(confFile); krbClient = new KrbClient(krbConfig); krbClient.init();