org.apache.solr.security

## Class BasicAuthPlugin

- java.lang.Object
- - org.apache.solr.security.AuthenticationPlugin
  - - org.apache.solr.security.BasicAuthPlugin

- All Implemented Interfaces:
    Closeable, AutoCloseable, ConfigEditablePlugin

      public class BasicAuthPlugin
      extends AuthenticationPlugin
      implements ConfigEditablePlugin

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `BasicAuthPlugin.AuthenticationProvider`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `BLOCK_UNKNOWN`

    - ### Fields inherited from class org.apache.solr.security.AuthenticationPlugin

      `AUTHENTICATION_PLUGIN_PROP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicAuthPlugin()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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()`
    `void` | `init(Map<String,Object> pluginConfig)` This is called upon loading up of a plugin, used for setting it up.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### BLOCK_UNKNOWN

          public static final String BLOCK_UNKNOWN

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### BasicAuthPlugin

          public BasicAuthPlugin()

  - ### Method Detail

    - #### authenticate

          public boolean authenticate(String username,
                                      String pwd)

    - #### init

          public void init(Map<String,Object> pluginConfig)

      Description copied from class: `AuthenticationPlugin`
      This is called upon loading up of a plugin, used for setting it up.
      Specified by:
        `init` in class `AuthenticationPlugin`
      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: `ConfigEditablePlugin`
      Operate 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:
        `edit` in interface `ConfigEditablePlugin`

    - #### 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 Exception

      Description copied from class: `AuthenticationPlugin`
      This 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:
        `doAuthenticate` in class `AuthenticationPlugin`
      Parameters:
        `servletRequest` - the http request
        `servletResponse` - the http response
        `filterChain` - 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:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

    - #### closeRequest

          public void closeRequest()

      Description copied from class: `AuthenticationPlugin`
      Cleanup any per request data
      Overrides:
        `closeRequest` in class `AuthenticationPlugin`

    - #### getBlockUnknown

          public boolean getBlockUnknown()

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.