public class InternalAuthentication extends Object implements com.googlecode.fascinator.api.authentication.Authentication
This plugin implements the Fascinator default internal userbase. This plugin mostly a direct port from Fascinator IR code and is a very minimal proof-of-concept implemetation of authentication. Currently it only authenticates from a userbase stored in a local file.
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": "internal",
"internal": {
"path": "${user.home}/.fascinator/users.properties"
}
}
None
| Constructor and Description |
|---|
InternalAuthentication() |
| Modifier and Type | Method and Description |
|---|---|
void |
changePassword(String username,
String password)
Change a user's password.
|
com.googlecode.fascinator.api.authentication.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() |
com.googlecode.fascinator.api.PluginDescription |
getPluginDetails()
Gets a PluginDescription object relating to this plugin.
|
com.googlecode.fascinator.api.authentication.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 Internal Authentication plugin
|
com.googlecode.fascinator.api.authentication.User |
logIn(String username,
String password)
Tests the user's username/password validity.
|
void |
logOut(com.googlecode.fascinator.api.authentication.User user)
Optional logout method if the implementing class wants to do any
post-processing.
|
com.googlecode.fascinator.api.authentication.User |
modifyUser(String username,
String property,
boolean newValue) |
com.googlecode.fascinator.api.authentication.User |
modifyUser(String username,
String property,
int newValue) |
com.googlecode.fascinator.api.authentication.User |
modifyUser(String username,
String property,
String newValue)
Modify one of the user's properties.
|
List<com.googlecode.fascinator.api.authentication.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.
|
public String getId()
getId in interface com.googlecode.fascinator.api.Pluginpublic String getName()
getName in interface com.googlecode.fascinator.api.Pluginpublic com.googlecode.fascinator.api.PluginDescription getPluginDetails()
getPluginDetails in interface com.googlecode.fascinator.api.Pluginpublic void init(String jsonString) throws com.googlecode.fascinator.api.authentication.AuthenticationException
init in interface com.googlecode.fascinator.api.Plugincom.googlecode.fascinator.api.authentication.AuthenticationException - if fails to initialisepublic void init(File jsonFile) throws com.googlecode.fascinator.api.authentication.AuthenticationException
init in interface com.googlecode.fascinator.api.Plugincom.googlecode.fascinator.api.authentication.AuthenticationExceptionpublic void shutdown()
throws com.googlecode.fascinator.api.authentication.AuthenticationException
shutdown in interface com.googlecode.fascinator.api.Plugincom.googlecode.fascinator.api.authentication.AuthenticationExceptionpublic com.googlecode.fascinator.api.authentication.User logIn(String username, String password) throws com.googlecode.fascinator.api.authentication.AuthenticationException
logIn in interface com.googlecode.fascinator.api.authentication.Authenticationusername - The username of the user logging in.password - The password of the user logging in.com.googlecode.fascinator.api.authentication.AuthenticationException - if there was an error logging in.public void logOut(com.googlecode.fascinator.api.authentication.User user)
throws com.googlecode.fascinator.api.authentication.AuthenticationException
logOut in interface com.googlecode.fascinator.api.authentication.Authenticationusername - The username of the logging out user.com.googlecode.fascinator.api.authentication.AuthenticationException - if there was an error logging out.public boolean supportsUserManagement()
supportsUserManagement in interface com.googlecode.fascinator.api.authentication.Authenticationpublic String describeUser()
describeUser in interface com.googlecode.fascinator.api.authentication.Authenticationpublic com.googlecode.fascinator.api.authentication.User createUser(String username, String password) throws com.googlecode.fascinator.api.authentication.AuthenticationException
createUser in interface com.googlecode.fascinator.api.authentication.Authenticationusername - The username of the new user.password - The password of the new user.com.googlecode.fascinator.api.authentication.AuthenticationException - if there was an error creating the user.public void deleteUser(String username) throws com.googlecode.fascinator.api.authentication.AuthenticationException
deleteUser in interface com.googlecode.fascinator.api.authentication.Authenticationusername - The username of the user to delete.com.googlecode.fascinator.api.authentication.AuthenticationException - if there was an error during deletion.public void changePassword(String username, String password) throws com.googlecode.fascinator.api.authentication.AuthenticationException
changePassword in interface com.googlecode.fascinator.api.authentication.Authenticationusername - The user changing their password.password - The new password for the user.com.googlecode.fascinator.api.authentication.AuthenticationException - if there was an error changing the
password.public com.googlecode.fascinator.api.authentication.User modifyUser(String username, String property, String newValue) throws com.googlecode.fascinator.api.authentication.AuthenticationException
modifyUser in interface com.googlecode.fascinator.api.authentication.Authenticationusername - The user being modified.property - The user property being modified.newValue - The new value to be assigned to the property.com.googlecode.fascinator.api.authentication.AuthenticationException - if there was an error during
modification.public com.googlecode.fascinator.api.authentication.User modifyUser(String username, String property, int newValue) throws com.googlecode.fascinator.api.authentication.AuthenticationException
modifyUser in interface com.googlecode.fascinator.api.authentication.Authenticationcom.googlecode.fascinator.api.authentication.AuthenticationExceptionpublic com.googlecode.fascinator.api.authentication.User modifyUser(String username, String property, boolean newValue) throws com.googlecode.fascinator.api.authentication.AuthenticationException
modifyUser in interface com.googlecode.fascinator.api.authentication.Authenticationcom.googlecode.fascinator.api.authentication.AuthenticationExceptionpublic com.googlecode.fascinator.api.authentication.User getUser(String username) throws com.googlecode.fascinator.api.authentication.AuthenticationException
getUser in interface com.googlecode.fascinator.api.authentication.Authenticationusername - The username of the user required.com.googlecode.fascinator.api.authentication.AuthenticationException - if there was an error retrieving the
object.public List<com.googlecode.fascinator.api.authentication.User> searchUsers(String search) throws com.googlecode.fascinator.api.authentication.AuthenticationException
searchUsers in interface com.googlecode.fascinator.api.authentication.Authenticationsearch - The search string to execute.com.googlecode.fascinator.api.authentication.AuthenticationException - if there was an error searching.Copyright © 2009-2015. All Rights Reserved.