0

I've tried with both Apache Zeppelin 0.8 and 0.9 + pac4j and the problem is the same. When visiting the app root at http://localhost:8081/ I get redirected to http://localhost:8081/null. log4j does not output anything that may help.

This is my shiro.ini file:

[main]
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
securityManager.sessionManager = $sessionManager
securityManager.sessionManager.globalSessionTimeout = 86400000

oidcConfig = org.pac4j.oidc.config.OidcConfiguration
oidcConfig.discoveryURI = http://localhost:8080/auth/realms/Test/.well-known/openid-configuration
oidcConfig.clientId = Zeppelin
oidcConfig.secret = e15b220e-9b3c-4997-9a76-81086e3e1ca3
oidcConfig.clientAuthenticationMethodAsString = client_secret_basic
oidcClient = org.pac4j.oidc.client.OidcClient
oidcClient.configuration = $oidcConfig


clients = org.pac4j.core.client.Clients
clients.callbackUrl = http://localhost:8081/api/callback
clients.clients = $oidcClient

requireRoleAdmin = org.pac4j.core.authorization.authorizer.RequireAnyRoleAuthorizer

config = org.pac4j.core.config.Config
config.clients = $clients

pac4jRealm = io.buji.pac4j.realm.Pac4jRealm
pac4jSubjectFactory = io.buji.pac4j.subject.Pac4jSubjectFactory
securityManager.subjectFactory = $pac4jSubjectFactory

oidcSecurityFilter = io.buji.pac4j.filter.SecurityFilter
oidcSecurityFilter.config = $config
oidcSecurityFilter.clients = oidcClient


callbackFilter = io.buji.pac4j.filter.CallbackFilter
callbackFilter.defaultUrl = http://localhost:8081
callbackFilter.config = $config

[urls]
/api/version = anon
/api/callback = callbackFilter
/** = oidcSecurityFilter
AlfredoRevilla-MSFT
  • 3,171
  • 1
  • 12
  • 18

2 Answers2

1

Add resolver will help redirect to the right oidc path

ajaxRequestResolver = org.pac4j.core.http.ajax.DefaultAjaxRequestResolver
ajaxRequestResolver.addRedirectionUrlAsHeader = true
oidcClient.ajaxRequestResolver = $ajaxRequestResolver
skantana
  • 11
  • 2
0

I believe this is a bug in one of the libraries. You could try to use specific versions of the underlying dependencies. This is the combination that helped me to solve this null problem:

https://repo1.maven.org/maven2/org/apache/commons/commons-collections4/4.4/commons-collections4-4.4.jar
https://repo1.maven.org/maven2/com/nimbusds/lang-tag/1.5/lang-tag-1.5.jar
https://repo1.maven.org/maven2/net/minidev/json-smart/2.4.7/json-smart-2.4.7.jar
https://repo1.maven.org/maven2/com/nimbusds/oauth2-oidc-sdk/9.9/oauth2-oidc-sdk-9.9.jar
https://repo1.maven.org/maven2/com/nimbusds/content-type/2.1/content-type-2.1.jar
https://repo1.maven.org/maven2/javax/mail/mail/1.4.7/mail-1.4.7.jar
https://repo1.maven.org/maven2/io/buji/buji-pac4j/5.0.1/buji-pac4j-5.0.1.jar
https://repo1.maven.org/maven2/org/pac4j/pac4j-core/4.0.3/pac4j-core-4.0.3.jar
https://repo1.maven.org/maven2/org/pac4j/pac4j-oidc/4.0.3/pac4j-oidc-4.0.3.jar
Slava Schmidt
  • 296
  • 2
  • 12