org.apache.tinkerpop.gremlin.server.auth

## Class SimpleAuthenticator

- java.lang.Object
- - org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator

- All Implemented Interfaces:
    Authenticator

      public class SimpleAuthenticator
      extends Object
      implements Authenticator

  A simple implementation of an `Authenticator` that uses a `Graph` instance as a credential store. Management of the credential store can be handled through the `CredentialGraph` DSL.
  Author:
    Stephen Mallette (http://stephen.genoprime.com)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.server.auth.Authenticator

      `Authenticator.SaslNegotiator`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CONFIG_CREDENTIALS_DB` The location of the configuration file that contains the credentials database.
    `static String` | `CONFIG_CREDENTIALS_LOCATION` Deprecated. As of release 3.1.1-incubating, if using TinkerGraph, simply rely on it's "persistence" features.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleAuthenticator()`

  - ### Method Summary

    All Methods Instance Methods Concrete 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 `Authenticator.newSaslNegotiator(InetAddress)`.
    `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`.

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

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

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.server.auth.Authenticator

      `newSaslNegotiator`

- - ### Field Detail

    - #### CONFIG_CREDENTIALS_LOCATION

          @Deprecated
          public static final String CONFIG_CREDENTIALS_LOCATION

      Deprecated. As of release 3.1.1-incubating, if using TinkerGraph, simply rely on it's "persistence" features.
      See Also:
        TINKERPOP-981, Constant Field Values

    - #### CONFIG_CREDENTIALS_DB

          public static final String CONFIG_CREDENTIALS_DB

      The location of the configuration file that contains the credentials database.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SimpleAuthenticator

          public SimpleAuthenticator()

  - ### Method Detail

    - #### requireAuthentication

          public boolean requireAuthentication()

      Description copied from interface: `Authenticator`
      Whether or not the authenticator requires explicit login. If false will instantiate user with AuthenticatedUser.ANONYMOUS_USER.
      Specified by:
        `requireAuthentication` in interface `Authenticator`

    - #### setup

          public void setup(Map<String,Object> config)

      Description copied from interface: `Authenticator`
      Setup is called once upon system startup to initialize the `Authenticator`.
      Specified by:
        `setup` in interface `Authenticator`

    - #### newSaslNegotiator

          @Deprecated
          public Authenticator.SaslNegotiator newSaslNegotiator()

      Deprecated. As of release 3.1.1-incubating, replaced by `Authenticator.newSaslNegotiator(InetAddress)`.
      Description copied from interface: `Authenticator`
      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.)
      Specified by:
        `newSaslNegotiator` in interface `Authenticator`
      See Also:
        TINKERPOP-995

    - #### authenticate

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

      Description copied from interface: `Authenticator`
      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).
      Specified by:
        `authenticate` in interface `Authenticator`
      Throws:
        `AuthenticationException`

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