use of org.apache.accumulo.server.security.handler.Authenticator in project accumulo by apache.
the class SecurityOperation method getAuthenticator.
protected static Authenticator getAuthenticator(String instanceId, boolean initialize) {
AccumuloConfiguration conf = SiteConfiguration.getInstance();
Authenticator toRet = Property.createInstanceFromPropertyName(conf, Property.INSTANCE_SECURITY_AUTHENTICATOR, Authenticator.class, ZKAuthenticator.getInstance());
toRet.initialize(instanceId, initialize);
return toRet;
}
use of org.apache.accumulo.server.security.handler.Authenticator in project accumulo by apache.
the class LoginProperties method execute.
@Override
public void execute(String[] args) throws Exception {
AccumuloConfiguration config = new ServerConfigurationFactory(HdfsZooInstance.getInstance()).getSystemConfiguration();
Authenticator authenticator = AccumuloVFSClassLoader.getClassLoader().loadClass(config.get(Property.INSTANCE_SECURITY_AUTHENTICATOR)).asSubclass(Authenticator.class).newInstance();
List<Set<TokenProperty>> tokenProps = new ArrayList<>();
for (Class<? extends AuthenticationToken> tokenType : authenticator.getSupportedTokenTypes()) {
tokenProps.add(tokenType.newInstance().getProperties());
}
System.out.println("Supported token types for " + authenticator.getClass().getName() + " are : ");
for (Class<? extends AuthenticationToken> tokenType : authenticator.getSupportedTokenTypes()) {
System.out.println("\t" + tokenType.getName() + ", which accepts the following properties : ");
for (TokenProperty tokenProperty : tokenType.newInstance().getProperties()) {
System.out.println("\t\t" + tokenProperty);
}
System.out.println();
}
}
Aggregations