-
Notifications
You must be signed in to change notification settings - Fork 134
Ability to get a JWT token from an OIDC provider to make calls to Solr secured by the JWTAuthPlugin #346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…when using probesRequireAuth
…S if OIDC provider URL is not https
…orking with services like Auth0
|
As I progressed with this impl, I realized that the Prometheus exporter doesn't support JWT right now. Found these JIRAs that are important for this effort: |
|
Now this PR only has OIDC related changes in it. However, it's unlikely I'll merge this into main anytime soon given the limitations with JWT / OIDC on the Solr side (see previous comments); at least not until SolrJ supports OIDC (so that the prometheus exporter works). |
|
Closing this. Can revive it in a new PR some time later if necessary |
|
@thelabdude following this thread, related to my current issue, do you know if a JWT, to be used in the Solr API, can be generated without a human user login into a web form? Because we have the case of system to system auth, leaving the end user GUI open for searching. Thanks! |
|
You can use a MultiAuthPlugin in Solr and use JWT for humans and BasicAuth for Operator and Prom Exporter. |
|
@janhoy I want to use JWT for app to solr, not for humans, my search app is open for users but I don't want other apps to talk to solr, is that possible? I like tokens to expire and be renewed, instead of using basic auth. Having app level auth would be useful in this scenario. Thanks. |
|
@janhoy Is there an example or instructions on how to use MultiAuthPlugin with the operator? |
|
To use Multi with the operator you'll need to craft the security.json yourself (e.g. through a Helm template), put it in a secret, and then tell Solr Operator to use that secret. I don't think you'll get much help from the operator itself. |
Fixes #331
Manually tested with Keycloak.
I went with calling this AuthenticationType
Oidceven though technically, we're only using theclient_credentialsgrant type in OAuth2 (see: https://datatracker.ietf.org/doc/html/rfc6749#section-4.4); there's no redirecting or any of that fancy OIDC stuff. I likeOidcbecause that corresponds better with theJWTAuthPluginused by Solr and our config takes awellKnownUrlwhich is an OIDC thing.Example SolrCloud CRD YAML:
security.json for Keycloak:
Todo:
The biggest issue I see with adding this feature is the Prometheus exporter and the bin/solr script don't support the JWTAuthPlugin (see: https://issues.apache.org/jira/browse/SOLR-12666) so users would have to open up access to anonymous requests for those endpoints. So I wonder if the better approach is to improve Solr to support multiple authentication schemes based on the provided Authorization header either
BearerorBasic