Uploaded image for project: 'Zeppelin'
  1. Zeppelin
  2. ZEPPELIN-5182

Zeppelin authentication with JDBC realm is not working

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • docker, Kubernetes, security
    • None

    Description

      Hi Team,

      I have been trying to set up zeppelin with authentication with Shiro JDBC realm. After all my attempts, I have not been able to get it working. The basic authentication works but with JDBC realm it fails.

       

      The zeppelin server was created following the doc: http://zeppelin.apache.org/docs/0.9.0/quickstart/kubernetes.html

       

      The POD is working.

       

      I enabled the Shiro by extending the docker image. My Dockerfile:

       

      ARG ZEPPELIN_IMAGE=apache/zeppelin:0.9.0
      FROM ${ZEPPELIN_IMAGE}
      #https://hub.docker.com/r/apache/zeppelin/dockerfile
      
      
      WORKDIR ${Z_HOME}
      
      ADD /zeppelin/shiro.ini ${Z_HOME}/conf/
      
      ADD https://repo1.maven.org/maven2/mysql/mysql-connector-java/6.0.4/mysql-connector-java-6.0.4.jar ${Z_HOME}/lib/
      ENV CLASSPATH=${Z_HOME}/lib/mysql-connector-java-6.0.4.jar:${CLASSPATH}
      
      ENTRYPOINT [ "/usr/bin/tini", "--" ]
      WORKDIR ${Z_HOME}
      CMD ["bin/zeppelin.sh"]
      

       

      My shiro.ini taken from https://gist.github.com/adamjshook/6c42b03fdb09b60cd519174d0aec1af5

      [main]
      ds = com.mysql.jdbc.jdbc2.optional.MysqlDataSource
      ds.serverName = localhost
      ds.databaseName = zeppelin
      ds.user = zeppelin
      ds.password = zeppelin
      jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm
      jdbcRealmCredentialsMatcher = org.apache.shiro.authc.credential.Sha256CredentialsMatcher
      jdbcRealm.credentialsMatcher = $jdbcRealmCredentialsMatcher
      ps = org.apache.shiro.authc.credential.DefaultPasswordService
      pm = org.apache.shiro.authc.credential.PasswordMatcher
      pm.passwordService = $ps
      jdbcRealm.dataSource = $ds
      jdbcRealm.credentialsMatcher = $pm
      shiro.loginUrl = /api/login
      [urls]/** = authc
      

      Now, when I deploy the zeppelin server, I get:

      Unable to instantiate class [com.mysql.jdbc.jdbc2.optional.MysqlDataSource] for object named 'ds'.  Please ensure you've specified the fully qualified class name correctly.
      

      Not sure why it is failing even I have defined the jar file on classpath.

       

      Attachments

        1. logs-from-zeppelin-server.txt
          30 kB
          Suchit gupta

        Activity

          People

            Unassigned Unassigned
            suchitgupta Suchit gupta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: