tcMenuJavaAPI
Public Member Functions | List of all members
com.thecoderscorner.menu.auth.PropertiesAuthenticator Class Reference
Inheritance diagram for com.thecoderscorner.menu.auth.PropertiesAuthenticator:
com.thecoderscorner.menu.auth.MenuAuthenticator

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 ()
 

Detailed Description

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.

Member Function Documentation

◆ addAuthentication()

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.

Parameters
userthe user to add
uuidthe uuid associated with the user
Returns
a future that can be tracked to indicate if the authentication was accepted

Implements com.thecoderscorner.menu.auth.MenuAuthenticator.

◆ authenticate()

boolean com.thecoderscorner.menu.auth.PropertiesAuthenticator.authenticate ( String  user,
UUID  uuid 
)

Check if the user and UUID pair can connect to this board.

Parameters
userthe user to check for
uuidthe UUID to check for
Returns
true if the user and UUID are allowed, otherwise false

Implements com.thecoderscorner.menu.auth.MenuAuthenticator.

◆ doesPasscodeMatch()

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.

Parameters
passcodethe passcode to check
Returns
true if matching, otherwise false

Implements com.thecoderscorner.menu.auth.MenuAuthenticator.

◆ getAllNames()

List<String> com.thecoderscorner.menu.auth.PropertiesAuthenticator.getAllNames ( )

Gets a list of all apps/users stored in the system

Returns
the list of users

Implements com.thecoderscorner.menu.auth.MenuAuthenticator.

◆ managementCapabilities()

ManagementCapabilities com.thecoderscorner.menu.auth.PropertiesAuthenticator.managementCapabilities ( )

Indicates how this authenticator can be edited, some don't support any, some remove only.

Returns
how the authenticator can be managed

Implements com.thecoderscorner.menu.auth.MenuAuthenticator.

◆ removeAuthentication()

void com.thecoderscorner.menu.auth.PropertiesAuthenticator.removeAuthentication ( String  user)

Remove the authentication for the given user

Parameters
userthe user to remove

Implements com.thecoderscorner.menu.auth.MenuAuthenticator.


The documentation for this class was generated from the following file: