Package org.apache.solr.security
Class BasicAuthPlugin
- java.lang.Object
 - 
- org.apache.solr.security.AuthenticationPlugin
 - 
- org.apache.solr.security.BasicAuthPlugin
 
 
 
- 
- All Implemented Interfaces:
 Closeable,AutoCloseable,SpecProvider,ConfigEditablePlugin
public class BasicAuthPlugin extends AuthenticationPlugin implements ConfigEditablePlugin, SpecProvider
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBasicAuthPlugin.AuthenticationProvider 
- 
Field Summary
Fields Modifier and Type Field Description static StringPROPERTY_BLOCK_UNKNOWNstatic StringPROPERTY_REALM- 
Fields inherited from class org.apache.solr.security.AuthenticationPlugin
AUTHENTICATION_PLUGIN_PROP 
 - 
 
- 
Constructor Summary
Constructors Constructor Description BasicAuthPlugin() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanauthenticate(String username, String pwd)voidclose()voidcloseRequest()Cleanup any per request databooleandoAuthenticate(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.AuthenticationProvidergetAuthenticationProvider(Map<String,Object> pluginConfig)booleangetBlockUnknown()ValidatingJsonMapgetSpec()voidinit(Map<String,Object> pluginConfig)This is called upon loading up of a plugin, used for setting it up. 
 - 
 
- 
- 
Field Detail
- 
PROPERTY_BLOCK_UNKNOWN
public static final String PROPERTY_BLOCK_UNKNOWN
- See Also:
 - Constant Field Values
 
 
- 
PROPERTY_REALM
public static final String PROPERTY_REALM
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
init
public void init(Map<String,Object> pluginConfig)
Description copied from class:AuthenticationPluginThis is called upon loading up of a plugin, used for setting it up.- Specified by:
 initin classAuthenticationPlugin- Parameters:
 pluginConfig- Config parameters, possibly from a ZK source
 
- 
edit
public Map<String,Object> edit(Map<String,Object> latestConf, List<CommandOperation> commands)
Description copied from interface:ConfigEditablePluginOperate the commands on the latest conf and return a new conf object If there are errors in the commands , throw a SolrException. return a null if no changes are to be made as a result of this edit. It is the responsibility of the implementation to ensure that the returned config is valid . The framework does no validation of the data- Specified by:
 editin interfaceConfigEditablePlugin
 
- 
getAuthenticationProvider
protected BasicAuthPlugin.AuthenticationProvider getAuthenticationProvider(Map<String,Object> pluginConfig)
 
- 
doAuthenticate
public boolean doAuthenticate(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain) throws ExceptionDescription copied from class:AuthenticationPluginThis method attempts to authenticate the request. Upon a successful authentication, this must call the next filter in the filter chain and set the user principal of the request, or else, upon an error or an authentication failure, throw an exception.- Specified by:
 doAuthenticatein classAuthenticationPlugin- Parameters:
 servletRequest- the http requestservletResponse- the http responsefilterChain- the servlet filter chain- Returns:
 - false if the request not be processed by Solr (not continue), i.e. the response and status code have already been sent.
 - Throws:
 Exception- any exception thrown during the authentication, e.g. PrivilegedActionException
 
- 
close
public void close() throws IOException- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Throws:
 IOException
 
- 
closeRequest
public void closeRequest()
Description copied from class:AuthenticationPluginCleanup any per request data- Overrides:
 closeRequestin classAuthenticationPlugin
 
- 
getSpec
public ValidatingJsonMap getSpec()
- Specified by:
 getSpecin interfaceSpecProvider
 
- 
getBlockUnknown
public boolean getBlockUnknown()
 
 - 
 
 -