ServerAuthenticationProvider (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.server.auth

## Class ServerAuthenticationProvider

- java.lang.Object
- - org.apache.zookeeper.server.auth.ServerAuthenticationProvider

- All Implemented Interfaces:
    AuthenticationProvider
  Direct Known Subclasses:
    KeyAuthenticationProvider

      public abstract class ServerAuthenticationProvider
      extends Object
      implements AuthenticationProvider

  A variation on `AuthenticationProvider` that provides additional parameters for more detailed authentication

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ServerAuthenticationProvider.MatchValues`
    `static class` | `ServerAuthenticationProvider.ServerObjs`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServerAuthenticationProvider()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract KeeperException.Code` | `handleAuthentication(ServerAuthenticationProvider.ServerObjs serverObjs, byte[] authData)` This method is called when a client passes authentication data for this scheme.
    `KeeperException.Code` | `handleAuthentication(ServerCnxn cnxn, byte[] authData)` This method is called when a client passes authentication data for this scheme.
    `abstract boolean` | `matches(ServerAuthenticationProvider.ServerObjs serverObjs, ServerAuthenticationProvider.MatchValues matchValues)` This method is called to see if the given id matches the given id expression in the ACL.
    `boolean` | `matches(String id, String aclExpr)` This method is called to see if the given id matches the given id expression in the ACL.

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

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

    - ### Methods inherited from interface org.apache.zookeeper.server.auth.AuthenticationProvider

      `getScheme, getUserName, isAuthenticated, isValid`

- - ### Constructor Detail

    - #### ServerAuthenticationProvider

          public ServerAuthenticationProvider()

  - ### Method Detail

    - #### handleAuthentication

          public abstract KeeperException.Code handleAuthentication(ServerAuthenticationProvider.ServerObjs serverObjs,
                                                                    byte[] authData)

      This method is called when a client passes authentication data for this scheme. The authData is directly from the authentication packet. The implementor may attach new ids to the authInfo field of cnxn or may use cnxn to send packets back to the client.
      Parameters:
        `serverObjs` - cnxn/server/etc that received the authentication information.
        `authData` - the authentication data received.
      Returns:
        indication of success or failure

    - #### matches

          public abstract boolean matches(ServerAuthenticationProvider.ServerObjs serverObjs,
                                          ServerAuthenticationProvider.MatchValues matchValues)

      This method is called to see if the given id matches the given id expression in the ACL. This allows schemes to use application specific wild cards.
      Parameters:
        `serverObjs` - cnxn/server/etc that received the authentication information.
        `matchValues` - values to be matched

    - #### handleAuthentication

          public final KeeperException.Code handleAuthentication(ServerCnxn cnxn,
                                                                 byte[] authData)

      Description copied from interface: `AuthenticationProvider`
      This method is called when a client passes authentication data for this scheme. The authData is directly from the authentication packet. The implementor may attach new ids to the authInfo field of cnxn or may use cnxn to send packets back to the client.
      Specified by:
        `handleAuthentication` in interface `AuthenticationProvider`
      Parameters:
        `cnxn` - the cnxn that received the authentication information.
        `authData` - the authentication data received.
      Returns:
        TODO

    - #### matches

          public final boolean matches(String id,
                                       String aclExpr)

      Description copied from interface: `AuthenticationProvider`
      This method is called to see if the given id matches the given id expression in the ACL. This allows schemes to use application specific wild cards.
      Specified by:
        `matches` in interface `AuthenticationProvider`
      Parameters:
        `id` - the id to check.
        `aclExpr` - the expression to match ids against.
      Returns:
        true if the id can be matched by the expression.

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.