use of sun.security.jgss.LoginConfigImpl in project jdk8u_jdk by JetBrains.
the class DefaultGssConfig method main.
public static void main(String[] argv) throws Exception {
// 1. Make sure the FileNotFoundException is hidden
try {
Configuration.getInstance("JavaLoginConfig", new URIParameter(new URI("file:///no/such/file")));
} catch (NoSuchAlgorithmException nsae) {
if (nsae.getCause() instanceof IOException && !(nsae.getCause() instanceof FileNotFoundException)) {
// ignore
} else {
throw nsae;
}
}
// 2. Make sure there's always a Configuration even if no config file exists
Configuration.getConfiguration();
// 3. Make sure there're default entries for GSS krb5 client/server
LoginConfigImpl lc = new LoginConfigImpl(GSSCaller.CALLER_INITIATE, GSSUtil.GSS_KRB5_MECH_OID);
if (lc.getAppConfigurationEntry("").length == 0) {
throw new Exception("No default config for GSS krb5 client");
}
lc = new LoginConfigImpl(GSSCaller.CALLER_ACCEPT, GSSUtil.GSS_KRB5_MECH_OID);
if (lc.getAppConfigurationEntry("").length == 0) {
throw new Exception("No default config for GSS krb5 server");
}
}
Aggregations