Hello :wave: I'm using pac4j extension to authenti...
# general
j
Hello 👋 I'm using pac4j extension to authenticate users. In current implementation if the user is denied access from authentication provider (in this case user is not assigned to the okta group) it ends up with 401 screen. I wonder if that would be possible for this user to fallback to the next authentication method in authentication chain - since I also allow using basic authentication. But I'm not sure if this logic is forced by pac4j itself or we could modify the pac4j-extension logic to cover case like this. Or maybe there is something that I misconfigured? Any ideas?
âž• 1
k
have you tried something like
Copy code
druid.auth.authenticator.pac4j.skipOnFailure=true
🙌 1
j
Ah, that's a good tip - I got this enabled but only for basic authenticator. Forgot that it's not general option but rather it is set per-authenticator. Will check it out, thanks!
🙌 1
Still having problem with 401 after Okta authentication with pac4j extension. Unfortunately, I've tried
druid.auth.authenticator.pac4j.skipOnFailure=true
and it doesn't work neither. In router logs I see:
Copy code
2024-06-10T10:58:44,024 ERROR [qtp1022680775-84] org.pac4j.oidc.credentials.extractor.OidcExtractor - Bad authentication response, error=access_denied
And user reports that the same error screen (401) is popping up after logging with Okta, a dead end. This user has access to Okta, but is not assigned to the (druid) app, which results in 401. Relevant piece of common config:
Copy code
druid.auth.authenticatorChain=["MyBasicMetadataAuthenticator", "pac4j", "anonymous"]
    druid.auth.authenticator.pac4j.type=pac4j
    druid.auth.authenticator.pac4j.skipOnFailure=true
    druid.auth.pac4j.cookiePassphrase=testpassphrase
    druid.auth.pac4j.oidc.clientID={{ .auth.okta.clientID }}
    druid.auth.pac4j.oidc.clientSecret={ "type": "environment", "variable": "OIDC_SECRET" }
    druid.auth.pac4j.oidc.discoveryURI={{ .auth.okta.discoveryURI }}
    druid.auth.pac4j.oidc.scope={{ .auth.okta.oidcScope }}

    druid.auth.authorizers=["opaAuthorizer"]
    druid.auth.authorizer.opaAuthorizer.type=opa
    druid.auth.authorizer.opaAuthorizer.opaUri={{ .auth.okta.opaUri}}

    druid.auth.authenticator.pac4j.authorizerName=opaAuthorizer
    druid.auth.authenticator.MyBasicMetadataAuthenticator.authorizerName=opaAuthorizer

    druid.auth.authenticator.anonymous.type=anonymous
    druid.auth.authenticator.anonymous.identity=defaultUser
    druid.auth.authenticator.anonymous.authorizerName=opaAuthorizer
k
😮 thanks for letting me know!