Search in sources :

Example 1 with Authenticator

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;
}
Also used : Authenticator(org.apache.accumulo.server.security.handler.Authenticator) ZKAuthenticator(org.apache.accumulo.server.security.handler.ZKAuthenticator) KerberosAuthenticator(org.apache.accumulo.server.security.handler.KerberosAuthenticator) AccumuloConfiguration(org.apache.accumulo.core.conf.AccumuloConfiguration)

Example 2 with Authenticator

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();
    }
}
Also used : Set(java.util.Set) ArrayList(java.util.ArrayList) ServerConfigurationFactory(org.apache.accumulo.server.conf.ServerConfigurationFactory) TokenProperty(org.apache.accumulo.core.client.security.tokens.AuthenticationToken.TokenProperty) Authenticator(org.apache.accumulo.server.security.handler.Authenticator) AccumuloConfiguration(org.apache.accumulo.core.conf.AccumuloConfiguration)

Aggregations

AccumuloConfiguration (org.apache.accumulo.core.conf.AccumuloConfiguration)2 Authenticator (org.apache.accumulo.server.security.handler.Authenticator)2 ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 TokenProperty (org.apache.accumulo.core.client.security.tokens.AuthenticationToken.TokenProperty)1 ServerConfigurationFactory (org.apache.accumulo.server.conf.ServerConfigurationFactory)1 KerberosAuthenticator (org.apache.accumulo.server.security.handler.KerberosAuthenticator)1 ZKAuthenticator (org.apache.accumulo.server.security.handler.ZKAuthenticator)1