public class BasicAuthPlugin extends AuthenticationPlugin implements ConfigEditablePlugin, SpecProvider
| Modifier and Type | Class and Description |
|---|---|
static interface |
BasicAuthPlugin.AuthenticationProvider |
SolrInfoBean.Category, SolrInfoBean.Group| Modifier and Type | Field and Description |
|---|---|
static String |
FORWARD_CREDENTIALS |
static String |
PROPERTY_BLOCK_UNKNOWN |
static String |
PROPERTY_REALM |
AUTHENTICATION_PLUGIN_PROP, HTTP_HEADER_X_SOLR_AUTHDATA, metricManager, numAuthenticated, numErrors, numMissingCredentials, numPassThrough, numWrongCredentials, registryName, requests, requestTimes, totalTime| Constructor and Description |
|---|
BasicAuthPlugin() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticate(String username,
String pwd) |
void |
close() |
void |
closeRequest()
Cleanup any per request data
|
boolean |
doAuthenticate(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
This method attempts to authenticate the request.
|
Map<String,Object> |
edit(Map<String,Object> latestConf,
List<CommandOperation> commands)
Operate the commands on the latest conf and return a new conf object
If there are errors in the commands , throw a SolrException.
|
protected BasicAuthPlugin.AuthenticationProvider |
getAuthenticationProvider(Map<String,Object> pluginConfig) |
boolean |
getBlockUnknown() |
ValidatingJsonMap |
getSpec() |
void |
init(Map<String,Object> pluginConfig)
This is called upon loading up of a plugin, used for setting it up.
|
protected boolean |
interceptInternodeRequest(org.apache.http.HttpRequest httpRequest,
org.apache.http.protocol.HttpContext httpContext)
Override this method to intercept internode requests.
|
protected boolean |
interceptInternodeRequest(org.eclipse.jetty.client.api.Request request)
Override this method to intercept internode requests.
|
authenticate, getCategory, getDescription, getMetricNames, getMetricRegistry, getName, initializeMetricsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMetricsSnapshot, registerMetricNamepublic static final String PROPERTY_BLOCK_UNKNOWN
public static final String PROPERTY_REALM
public static final String FORWARD_CREDENTIALS
public void init(Map<String,Object> pluginConfig)
AuthenticationPlugininit in class AuthenticationPluginpluginConfig - Config parameters, possibly from a ZK sourcepublic Map<String,Object> edit(Map<String,Object> latestConf, List<CommandOperation> commands)
ConfigEditablePluginedit in interface ConfigEditablePluginprotected BasicAuthPlugin.AuthenticationProvider getAuthenticationProvider(Map<String,Object> pluginConfig)
public boolean doAuthenticate(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
throws Exception
AuthenticationPlugindoAuthenticate in class AuthenticationPluginservletRequest - the http requestservletResponse - the http responsefilterChain - the servlet filter chainException - any exception thrown during the authentication, e.g. PrivilegedActionExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void closeRequest()
AuthenticationPlugincloseRequest in class AuthenticationPluginprotected boolean interceptInternodeRequest(org.apache.http.HttpRequest httpRequest,
org.apache.http.protocol.HttpContext httpContext)
AuthenticationPluginPKIAuthenticationPlugin. Return true to indicate that your plugin
did handle the request, or false to signal that PKI plugin should handle it. This method
will be called by PKIAuthenticationPlugin's interceptor.
If not overridden, this method will return true for plugins implementing HttpClientBuilderPlugin.
This method can be overridden by subclasses e.g. to set HTTP headers, even if you don't use a clientBuilder.
interceptInternodeRequest in class AuthenticationPluginhttpRequest - the httpRequest that is about to be sent to another internal Solr nodehttpContext - the context of that request.protected boolean interceptInternodeRequest(org.eclipse.jetty.client.api.Request request)
AuthenticationPluginPKIAuthenticationPlugin. Return true to indicate that your plugin
did handle the request, or false to signal that PKI plugin should handle it. This method
will be called by PKIAuthenticationPlugin's interceptor.
If not overridden, this method will return true for plugins implementing HttpClientBuilderPlugin.
This method can be overridden by subclasses e.g. to set HTTP headers, even if you don't use a clientBuilder.
interceptInternodeRequest in class AuthenticationPluginrequest - the httpRequest that is about to be sent to another internal Solr nodepublic ValidatingJsonMap getSpec()
getSpec in interface SpecProviderpublic boolean getBlockUnknown()
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.