0

I am using zeppelin, and mostly my focus of exploration is on JDBC interpreter.

We want to provide a web interface for accessing the DB.

Intend is each user would login to Zeppelin, create its own credentials that should pass to jdbc interpreter.

So interpreter should be a shared one but DB connection should be based on each individual credential

Is this possible? Considering my users authentication is jdbc-realm

Referring document: https://zeppelin.apache.org/docs/0.9.0/setup/security/datasource_authorization.html

My shiro.ini:

[main]
dataSource                    = org.postgresql.ds.PGPoolingDataSource
dataSource.serverName         = localhost
dataSource.databaseName       = test
dataSource.user               = user_a
dataSource.password           = pass_a

ps = org.apache.shiro.authc.credential.DefaultPasswordService
pm = org.apache.shiro.authc.credential.PasswordMatcher
pm.passwordService = $ps

jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm
jdbcRealmCredentialsMatcher = org.apache.shiro.authc.credential.Sha256CredentialsMatcher


jdbcRealm.dataSource = $dataSource
jdbcRealm.authenticationQuery = select password from zeppelin.zeppelin_users where username = ?
jdbcRealm.userRolesQuery    = select role_name from zeppelin.zeppelin_user_roles where username = ?
jdbcRealm.credentialsMatcher = $pm


sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager

### If caching of user is required then uncomment below lines
#cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
#securityManager.cacheManager = $cacheManager

### Enables 'HttpOnly' flag in Zeppelin cookies
cookie = org.apache.shiro.web.servlet.SimpleCookie
cookie.name = JSESSIONID
cookie.httpOnly = true
### Uncomment the below line only when Zeppelin is running over HTTPS
#cookie.secure = true
sessionManager.sessionIdCookie = $cookie

securityManager.sessionManager = $sessionManager
# 86,400,000 milliseconds = 24 hour
securityManager.sessionManager.globalSessionTimeout = 86400000

shiro.loginUrl = /api/login

[roles]
role1 = *
role2 = *
role3 = *
admin = *

[urls]
/api/version = anon
/api/cluster/address = anon
# Allow all authenticated users to restart interpreters on a notebook page.
# Comment out the following line if you would like to authorize only admin users to restart interpreters.
/api/interpreter/setting/restart/** = authc
/api/interpreter/** = authc, roles[admin]
/api/notebook-repositories/** = authc, roles[admin]
/api/configurations/** = authc, roles[admin]
/api/credential/** = authc, roles[admin]
/api/admin/** = authc, roles[admin]
#/** = anon
/** = authc

Have created credentials: enter image description here

And have also removed default username and password from interpreter configuration enter image description here

Exception: org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was provided.

Version: 0.9.0-preview2

UPDATE: The same things works in 0.8.2 so seems issue with the 0.9.0 build

JDev
  • 1,662
  • 4
  • 25
  • 55

1 Answers1

0

As per ZEPPELIN-5184 and PR-4008, In 0.9.0, we need to define just the interpreter name in credentials.

Check ZEPPELIN-5189 for more details.

JDev
  • 1,662
  • 4
  • 25
  • 55