Skip to content

Apache Lucene open-source search software

SOLR-7703: Authentication plugin is now loaded using the RessourceLoader

Anshum Gupta82bb97f0057c
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index c7a6ccc1094..c17b71f02d3 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -324,6 +324,9 @@ Other Changes
* SOLR-7750: Change TestConfig.testDefaults to cover all SolrIndexConfig fields
(Christine Poerschke via Ramkumar Aiyengar)
+* SOLR-7703: Authentication plugin is now loaded using the RessourceLoader.
+ (Avi Digmi via Anshum Gupta)
+
================== 5.2.1 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release
diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
index 17ac7e5d2a8..883c73ce849 100644
--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java
+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
@@ -260,12 +260,7 @@ public class CoreContainer {
// Initialize the filter
if (pluginClassName != null) {
- try {
- Class cl = Class.forName(pluginClassName);
- authenticationPlugin = (AuthenticationPlugin) cl.newInstance();
- } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
- throw new SolrException(ErrorCode.SERVER_ERROR, e);
- }
+ authenticationPlugin = getResourceLoader().newInstance(pluginClassName, AuthenticationPlugin.class);
}
if (authenticationPlugin != null) {
authenticationPlugin.init(authenticationConfig);