Class SimpleAuthenticator
java.lang.Object
org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator
- All Implemented Interfaces:
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 CredentialTraversalDsl 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
FieldsModifier and TypeFieldDescriptionstatic final StringThe location of the configuration file that contains the credentials database. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(Map<String, String> credentials) A "standard" authentication implementation that can be used more generically without SASL support.newSaslNegotiator(InetAddress remoteAddress) Provide a SASL handler to perform authentication for an single connection.booleanWhether or not the authenticator requires explicit login.voidSetup is called once upon system startup to initialize theAuthenticator.
-
Field Details
-
CONFIG_CREDENTIALS_DB
The location of the configuration file that contains the credentials database.- See Also:
-
-
Constructor Details
-
SimpleAuthenticator
public SimpleAuthenticator()
-
-
Method Details
-
requireAuthentication
public boolean requireAuthentication()Description copied from interface:AuthenticatorWhether or not the authenticator requires explicit login. If false will instantiate user with AuthenticatedUser.ANONYMOUS_USER.- Specified by:
requireAuthenticationin interfaceAuthenticator
-
setup
Description copied from interface:AuthenticatorSetup is called once upon system startup to initialize theAuthenticator.- Specified by:
setupin interfaceAuthenticator
-
newSaslNegotiator
Description copied from interface:AuthenticatorProvide 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:
newSaslNegotiatorin interfaceAuthenticator- 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
public AuthenticatedUser authenticate(Map<String, String> credentials) throws AuthenticationExceptionDescription copied from interface:AuthenticatorA "standard" authentication implementation that can be used more generically without SASL support. This implementation is used when a particularChannelizerdoesn't support SASL directly (like basic HTTP authentication).- Specified by:
authenticatein interfaceAuthenticator- Throws:
AuthenticationException
-