Public Member Functions | |
PropertiesAuthenticator (String location) | |
PropertiesAuthenticator (String location, DialogManager dialogManager) | |
void | setDialogManager (DialogManager dialogManager) |
boolean | authenticate (String user, UUID uuid) |
CompletableFuture< Boolean > | addAuthentication (String user, UUID uuid, boolean needsApproval) |
void | removeAuthentication (String user) |
boolean | doesPasscodeMatch (String passcode) |
ManagementCapabilities | managementCapabilities () |
List< String > | getAllNames () |
Stores authentication to a properties file and then validates against the stored values. By default, there are no authentication pairs stored, and the secure passcode is "1234"
NOTE: This is only suited to very simple use cases where the level of security required is not particularly high and the file system of the device is completely secured. The authentication UUIDs are stored PLAIN TEXT.
CompletableFuture<Boolean> com.thecoderscorner.menu.auth.PropertiesAuthenticator.addAuthentication | ( | String | user, |
UUID | uuid, | ||
boolean | needsApproval | ||
) |
Adds an authentication token to the store, it assumes that all appropriate permission from the user has been sought.
user | the user to add |
uuid | the uuid associated with the user |
Implements com.thecoderscorner.menu.auth.MenuAuthenticator.
boolean com.thecoderscorner.menu.auth.PropertiesAuthenticator.authenticate | ( | String | user, |
UUID | uuid | ||
) |
Check if the user and UUID pair can connect to this board.
user | the user to check for |
uuid | the UUID to check for |
Implements com.thecoderscorner.menu.auth.MenuAuthenticator.
boolean com.thecoderscorner.menu.auth.PropertiesAuthenticator.doesPasscodeMatch | ( | String | passcode | ) |
Checks if the provided passcode matches with the security passcode and returns false if it does not match.
passcode | the passcode to check |
Implements com.thecoderscorner.menu.auth.MenuAuthenticator.
List<String> com.thecoderscorner.menu.auth.PropertiesAuthenticator.getAllNames | ( | ) |
Gets a list of all apps/users stored in the system
Implements com.thecoderscorner.menu.auth.MenuAuthenticator.
ManagementCapabilities com.thecoderscorner.menu.auth.PropertiesAuthenticator.managementCapabilities | ( | ) |
Indicates how this authenticator can be edited, some don't support any, some remove only.
Implements com.thecoderscorner.menu.auth.MenuAuthenticator.
void com.thecoderscorner.menu.auth.PropertiesAuthenticator.removeAuthentication | ( | String | user | ) |
Remove the authentication for the given user
user | the user to remove |
Implements com.thecoderscorner.menu.auth.MenuAuthenticator.