|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.googlecode.fascinator.authentication.filesystem.FileSystemAuthentication
public class FileSystemAuthentication
This plugin is a sample plugin on how to manage authentication against basic files on the filesystem.
Note: Since the internal authentication user plugin is essentially the same thing this plugin has no real purpose at this time and is just a copy. When the internal plugin evolves to be more sophisticated this plugin is expected to remain as an example to users of a basic filesystem implementation.
Standard configuration table:
| Option | Description | Required | Default |
|---|---|---|---|
| internal/path | File path in wich the userbase information is stored | Yes | ${user.home}/.fascinator/users.properties |
"authentication": {
"type": "filesystem",
"internal": {
"path": "${user.home}/.fascinator/users.properties"
}
}
None
| Constructor Summary | |
|---|---|
FileSystemAuthentication()
|
|
| Method Summary | |
|---|---|
void |
changePassword(String username,
String password)
A simplified method alternative to modifyUser() if the implementing class wants to just allow password changes. |
User |
createUser(String username,
String password)
Create a user. |
void |
deleteUser(String username)
Delete a user. |
String |
describeUser()
Describe the metadata the implementing class needs/allows for a user. |
String |
getId()
|
String |
getName()
|
PluginDescription |
getPluginDetails()
Gets a PluginDescription object relating to this plugin. |
User |
getUser(String username)
Returns a User object if the implementing class supports user queries without authentication. |
void |
init(File jsonFile)
|
void |
init(String jsonString)
Initialisation of Filesystem Authentication plugin |
User |
logIn(String username,
String password)
Tests the user's username/password validity. |
void |
logOut(User user)
Optional logout method if the implementing class wants to do any post-processing. |
User |
modifyUser(String username,
String property,
boolean newValue)
|
User |
modifyUser(String username,
String property,
int newValue)
|
User |
modifyUser(String username,
String property,
String newValue)
Modify one of the user's properties. |
List<User> |
searchUsers(String search)
Returns a list of users matching the search. |
void |
shutdown()
|
boolean |
supportsUserManagement()
Method for testing if the implementing plugin allows the creation, deletion and modification of users. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileSystemAuthentication()
| Method Detail |
|---|
public String getId()
getId in interface Pluginpublic String getName()
getName in interface Pluginpublic PluginDescription getPluginDetails()
getPluginDetails in interface Plugin
public void init(String jsonString)
throws AuthenticationException
init in interface PluginAuthenticationException - if fails to initialise
public void init(File jsonFile)
throws AuthenticationException
init in interface PluginAuthenticationException
public void shutdown()
throws AuthenticationException
shutdown in interface PluginAuthenticationException
public User logIn(String username,
String password)
throws AuthenticationException
logIn in interface Authenticationusername - The username of the user logging in.password - The password of the user logging in.
AuthenticationException - if there was an error logging in.
public void logOut(User user)
throws AuthenticationException
logOut in interface Authenticationusername - The username of the logging out user.
AuthenticationException - if there was an error logging out.public boolean supportsUserManagement()
supportsUserManagement in interface Authenticationpublic String describeUser()
describeUser in interface Authentication
public User createUser(String username,
String password)
throws AuthenticationException
createUser in interface Authenticationusername - The username of the new user.password - The password of the new user.
AuthenticationException - if there was an error creating the user.
public void deleteUser(String username)
throws AuthenticationException
deleteUser in interface Authenticationusername - The username of the user to delete.
AuthenticationException - if there was an error during deletion.
public void changePassword(String username,
String password)
throws AuthenticationException
changePassword in interface Authenticationusername - The user changing their password.password - The new password for the user.
AuthenticationException - if there was an error changing the password.
public User modifyUser(String username,
String property,
String newValue)
throws AuthenticationException
modifyUser in interface Authenticationusername - The user being modified.property - The user property being modified.newValue - The new value to be assigned to the property.
AuthenticationException - if there was an error during modification.
public User modifyUser(String username,
String property,
int newValue)
throws AuthenticationException
modifyUser in interface AuthenticationAuthenticationException
public User modifyUser(String username,
String property,
boolean newValue)
throws AuthenticationException
modifyUser in interface AuthenticationAuthenticationException
public User getUser(String username)
throws AuthenticationException
getUser in interface Authenticationusername - The username of the user required.
AuthenticationException - if there was an error retrieving the object.
public List<User> searchUsers(String search)
throws AuthenticationException
searchUsers in interface Authenticationsearch - The search string to execute.
AuthenticationException - if there was an error searching.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||