org.apache.tinkerpop.gremlin.server.auth

## Interface Authenticator

- All Known Implementing Classes:
    AllowAllAuthenticator, SimpleAuthenticator

      public interface Authenticator

  Provides methods related to authentication of a request. Implementations should provide a SASL based authentication method, but a handler can choose to use the `authenticate(Map)` method directly if required for protocols that don't easily support SASL.
  Author:
    Stephen Mallette (http://stephen.genoprime.com)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `Authenticator.SaslNegotiator` Performs the actual SASL negotiation for a single authentication attempt.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `AuthenticatedUser` | `authenticate(Map<String,String> credentials)` A "standard" authentication implementation that can be used more generically without SASL support.
    `Authenticator.SaslNegotiator` | `newSaslNegotiator()` Deprecated. As of release 3.1.1-incubating, replaced by `newSaslNegotiator(InetAddress)`.
    `default Authenticator.SaslNegotiator` | `newSaslNegotiator(InetAddress remoteAddress)` Provide a SASL handler to perform authentication for an single connection.
    `boolean` | `requireAuthentication()` Whether or not the authenticator requires explicit login.
    `void` | `setup(Map<String,Object> config)` Setup is called once upon system startup to initialize the `Authenticator`.

- - ### Method Detail

    - #### requireAuthentication

          boolean requireAuthentication()

      Whether or not the authenticator requires explicit login. If false will instantiate user with AuthenticatedUser.ANONYMOUS_USER.

    - #### setup

          void setup(Map<String,Object> config)

      Setup is called once upon system startup to initialize the `Authenticator`.

    - #### newSaslNegotiator

          @Deprecated
          Authenticator.SaslNegotiator newSaslNegotiator()

      Deprecated. As of release 3.1.1-incubating, replaced by `newSaslNegotiator(InetAddress)`.
      Provide a SASL handler to perform authentication for an single connection. SASL is a stateful protocol, so a new instance must be used for each authentication attempt.)
      See Also:
        TINKERPOP-995

    - #### newSaslNegotiator

          default Authenticator.SaslNegotiator newSaslNegotiator(InetAddress remoteAddress)

      Provide a SASL handler to perform authentication for an single connection. SASL is a stateful protocol, so a new instance must be used for each authentication attempt. As of 3.1.1, this method by default calls the `newSaslNegotiator()` method so as not to introduce a breaking change. Implementers should move their code from `newSaslNegotiator()` to this method as this is the method now called by Gremlin Server during authentication. For full backwards compatibility, it makes sense to call this method from `newSaslNegotiator()` passing `null` for the `remoteAddress` parameter.
      Parameters:
        `remoteAddress` - the IP address of the client to authenticate to authenticate or null if an internal client (one not connected over the remote transport).

    - #### authenticate

          AuthenticatedUser authenticate(Map<String,String> credentials)
                                  throws AuthenticationException

      A "standard" authentication implementation that can be used more generically without SASL support. This implementation is used when a particular `Channelizer` doesn't support SASL directly (like basic HTTP authentication).
      Throws:
        `AuthenticationException`

Copyright © 2013–2019 Apache Software Foundation. All rights reserved.