org.apache.solr.security

## Class AuthenticationPlugin

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

- All Implemented Interfaces:
    Closeable, AutoCloseable
  Direct Known Subclasses:
    BasicAuthPlugin, KerberosPlugin, PKIAuthenticationPlugin

      public abstract class AuthenticationPlugin
      extends Object
      implements Closeable

  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AuthenticationPlugin()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeRequest()` Cleanup any per request data
    `abstract boolean` | `doAuthenticate(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain)` This method attempts to authenticate the request.
    `abstract 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`

    - ### Methods inherited from interface java.io.Closeable

      `close`

- - ### Field Detail

    - #### AUTHENTICATION_PLUGIN_PROP

          public static final String AUTHENTICATION_PLUGIN_PROP

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AuthenticationPlugin

          public AuthenticationPlugin()

  - ### Method Detail

    - #### init

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

      This is called upon loading up of a plugin, used for setting it up.
      Parameters:
        `pluginConfig` - Config parameters, possibly from a ZK source

    - #### doAuthenticate

          public abstract boolean doAuthenticate(javax.servlet.ServletRequest request,
                                                 javax.servlet.ServletResponse response,
                                                 javax.servlet.FilterChain filterChain)
                                          throws Exception

      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.
      Parameters:
        `request` - the http request
        `response` - 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

    - #### closeRequest

          public void closeRequest()

      Cleanup any per request data

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