public class BasicAuthManager extends org.neo4j.kernel.lifecycle.LifecycleAdapter implements AuthManager
Through the BasicAuthManager you can create, update and delete users, and authenticate using credentials.
NO_AUTH| Constructor and Description |
|---|
BasicAuthManager(UserRepository users,
AuthenticationStrategy authStrategy) |
BasicAuthManager(UserRepository users,
AuthenticationStrategy authStrategy,
boolean authEnabled) |
BasicAuthManager(UserRepository users,
Clock clock,
boolean authEnabled) |
| Modifier and Type | Method and Description |
|---|---|
AuthenticationResult |
authenticate(String username,
String password)
Authenticate a username and password
|
boolean |
deleteUser(String username)
Delete the given user
|
User |
getUser(String username)
Retrieves the user with the provided user name.
|
AuthSubject |
login(String username,
String password)
Log in using the provided username and password
|
User |
newUser(String username,
String initialPassword,
boolean requirePasswordChange)
Create a new user with the provided credentials.
|
void |
setPassword(AuthSubject authSubject,
String username,
String password) |
User |
setPassword(String username,
String password)
Set the password of the provided user.
|
void |
start() |
public BasicAuthManager(UserRepository users, AuthenticationStrategy authStrategy, boolean authEnabled)
public BasicAuthManager(UserRepository users, AuthenticationStrategy authStrategy)
public BasicAuthManager(UserRepository users, Clock clock, boolean authEnabled)
public void start()
throws Throwable
start in interface org.neo4j.kernel.lifecycle.Lifecyclestart in class org.neo4j.kernel.lifecycle.LifecycleAdapterThrowablepublic AuthenticationResult authenticate(String username, String password)
AuthManagerauthenticate in interface AuthManagerusername - The name of the userpassword - The password of the userpublic AuthSubject login(String username, String password)
AuthManagerlogin in interface AuthManagerusername - The name of the userpassword - The password of the userpublic User newUser(String username, String initialPassword, boolean requirePasswordChange) throws IOException, IllegalCredentialsException
AuthManagernewUser in interface AuthManagerusername - The name of the user.initialPassword - The initial password.requirePasswordChange - Does the user need to change the initial password.IOException - If user can't be serialized to disk.IllegalCredentialsException - If the username is invalid.public boolean deleteUser(String username) throws IOException
AuthManagerdeleteUser in interface AuthManagerusername - the name of the user to delete.IOExceptionpublic User getUser(String username)
AuthManagergetUser in interface AuthManagerusername - The name of the user to retrieve.public void setPassword(AuthSubject authSubject, String username, String password) throws IOException
IOExceptionpublic User setPassword(String username, String password) throws IOException
AuthManagersetPassword in interface AuthManagerusername - The name of the user whose password should be set.password - The new password for the user.IOExceptionCopyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.