Class AuthTokens

java.lang.Object
org.neo4j.driver.AuthTokens

public final class AuthTokens extends Object
This is a listing of the various methods of authentication supported by this driver. The scheme used must be supported by the Neo4j Instance you are connecting to.
Since:
1.0
See Also:
  • Method Details

    • basic

      public static AuthToken basic(String username, String password)
      The basic authentication scheme, using a username and a password.
      Parameters:
      username - this is the "principal", identifying who this token represents
      password - this is the "credential", proving the identity of the user
      Returns:
      an authentication token that can be used to connect to Neo4j
      Throws:
      NullPointerException - when either username or password is null
      See Also:
    • basic

      public static AuthToken basic(String username, String password, String realm)
      The basic authentication scheme, using a username and a password.
      Parameters:
      username - this is the "principal", identifying who this token represents
      password - this is the "credential", proving the identity of the user
      realm - this is the "realm", specifies the authentication provider
      Returns:
      an authentication token that can be used to connect to Neo4j
      Throws:
      NullPointerException - when either username or password is null
      See Also:
    • bearer

      public static AuthToken bearer(String token)
      The bearer authentication scheme, using a base64 encoded token.
      Parameters:
      token - base64 encoded token
      Returns:
      an authentication token that can be used to connect to Neo4j
      Throws:
      NullPointerException - when token is null
      See Also:
    • kerberos

      public static AuthToken kerberos(String base64EncodedTicket)
      The kerberos authentication scheme, using a base64 encoded ticket
      Parameters:
      base64EncodedTicket - a base64 encoded service ticket
      Returns:
      an authentication token that can be used to connect to Neo4j
      Throws:
      NullPointerException - when ticket is null
      Since:
      1.3
      See Also:
    • custom

      public static AuthToken custom(String principal, String credentials, String realm, String scheme)
      A custom authentication token used for doing custom authentication on the server side.
      Parameters:
      principal - this used to identify who this token represents
      credentials - this is credentials authenticating the principal
      realm - this is the "realm:", specifying the authentication provider.
      scheme - this it the authentication scheme, specifying what kind of authentication that should be used
      Returns:
      an authentication token that can be used to connect to Neo4j
      Throws:
      NullPointerException - when either principal, credentials or scheme is null
      See Also:
    • custom

      public static AuthToken custom(String principal, String credentials, String realm, String scheme, Map<String,Object> parameters)
      A custom authentication token used for doing custom authentication on the server side.
      Parameters:
      principal - this used to identify who this token represents
      credentials - this is credentials authenticating the principal
      realm - this is the "realm:", specifying the authentication provider.
      scheme - this it the authentication scheme, specifying what kind of authentication that should be used
      parameters - extra parameters to be sent along the authentication provider.
      Returns:
      an authentication token that can be used to connect to Neo4j
      Throws:
      NullPointerException - when either principal, credentials or scheme is null
      See Also:
    • none

      public static AuthToken none()
      No authentication scheme. This will only work if authentication is disabled on the Neo4j Instance we are connecting to.
      Returns:
      an authentication token that can be used to connect to Neo4j instances with auth disabled
      See Also: