public class SecurityCentral
extends org.neo4j.kernel.lifecycle.LifecycleAdapter
| Modifier and Type | Field and Description |
|---|---|
static User |
UNAUTHENTICATED |
| Constructor and Description |
|---|
SecurityCentral(org.neo4j.helpers.Clock clock,
UserRepository users) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticate(String user,
String password)
Determine if a set of credentials are valid.
|
void |
newUser(String name,
Privileges privileges) |
String |
regenerateToken(String name)
Set a new random token for a given user
|
void |
setPassword(String name,
String password) |
void |
setToken(String name,
String token)
This is synchronized to avoid odd races if someone requests multiple concurrent token changes.
|
void |
start() |
User |
userForName(String name)
Get a user, given a name.
|
User |
userForToken(String token)
Get a user, given a token.
|
public static final User UNAUTHENTICATED
public SecurityCentral(org.neo4j.helpers.Clock clock,
UserRepository users)
public void start()
throws Throwable
start in interface org.neo4j.kernel.lifecycle.Lifecyclestart in class org.neo4j.kernel.lifecycle.LifecycleAdapterThrowablepublic boolean authenticate(String user, String password) throws TooManyAuthenticationAttemptsException
public void newUser(String name, Privileges privileges) throws IOException, IllegalUsernameException
IOExceptionIllegalUsernameExceptionpublic User userForToken(String token)
unauthenticated user.public User userForName(String name)
unauthenticated user.public String regenerateToken(String name) throws IOException
IOExceptionpublic void setToken(String name, String token) throws IllegalTokenException, IOException
IllegalTokenExceptionIOExceptionpublic void setPassword(String name, String password) throws IOException
IOExceptionCopyright © 2002–2014 The Neo4j Graph Database Project. All rights reserved.