drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Elango Ganesan <findela...@gmail.com>
Subject Fwd: Drill Custom Authentication Startup Exception
Date Tue, 01 Mar 2016 22:24:58 GMT
Hi All,


I tried creating a custom authenticator with Drill 1.5.0 by creating jar
based on below source code and drill configuration. I placed the jar in
$DRILLHOME/jars/


drill.exec: {

  cluster-id: "drillbits1",

  zk.connect: "dmdvhc0002d:2181,dmdvhc0003d:2181,dmdvhc0004d:2181"

 security.user.auth: {

            enabled: true,

            packages += “myorg.drill.security",

            impl: “sso"

       }

}

package myorg.drill.security;



import myorg.drill.security.SSOFilter;

import myorg.drill.security.SecurityServiceException;

import org.apache.drill.common.config.DrillConfig;

import org.apache.drill.exec.exception.DrillbitStartupException;

import org.apache.drill.exec.rpc.user.security.UserAuthenticationException;

import org.apache.drill.exec.rpc.user.security.UserAuthenticator;

import org.apache.drill.exec.rpc.user.security.UserAuthenticatorTemplate;


import java.io.IOException;

import java.net.InetAddress;

import java.net.UnknownHostException;



@UserAuthenticatorTemplate(type = “sso")

public class DrillMyUserAuthenticator implements UserAuthenticator {

private  String ipAddress;




    public void setup(DrillConfig drillConfig) throws DrillbitStartupException
{

        try {

            ipAddress= InetAddress.*getLocalHost*().getHostAddress();

        } catch (UnknownHostException e) {

            e.printStackTrace();

            throw new DrillbitStartupException(e);

        }

    }


    public void authenticate(String userName, String password) throws
UserAuthenticationException
{


        try {

            SSOFilter.*setSourceAddress*(ipAddress);

            SSOFilter.*authenticate*(userName, password);

        } catch (SecurityServiceException e) {

            e.printStackTrace();

            throw new UserAuthenticationException(e.getMessage());

        }


    }


    public void close() throws IOException {


    }

}


And I am getting below exception


exception in thread "main"
org.apache.drill.exec.exception.DrillbitStartupException: Failure while
initializing values in Drillbit.

at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:277)

at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:261)

at org.apache.drill.exec.server.Drillbit.main(Drillbit.java:257)

Caused by: org.apache.drill.exec.exception.DrillbitStartupException: Failed
to find the implementation of
'org.apache.drill.exec.rpc.user.security.UserAuthenticator' for type ’sso'

at
org.apache.drill.exec.rpc.user.security.UserAuthenticatorFactory.createAuthenticator(UserAuthenticatorFactory.java:103)

at org.apache.drill.exec.rpc.user.UserServer.<init>(UserServer.java:80)

at org.apache.drill.exec.service.ServiceEngine.<init>(ServiceEngine.java:79)

at org.apache.drill.exec.server.Drillbit.<init>(Drillbit.java:89)

at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:275)


Please let me know if I am missing something with the config or code. I
followed below steps in the documentation to create this


https://drill.apache.org/docs/configuring-user-authentication/


Thanks,

Elango

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message