Package com.thecoderscorner.menu.auth
Class PreDefinedAuthenticator
java.lang.Object
com.thecoderscorner.menu.auth.PreDefinedAuthenticator
- All Implemented Interfaces:
MenuAuthenticator
Implements the authentication interface using a pre-defined upfront set of name and UUID pairs that must be provided
upfront. This implementation will never save authentication blocks to storage.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.thecoderscorner.menu.auth.MenuAuthenticator
MenuAuthenticator.ManagementCapabilities -
Constructor Summary
ConstructorsConstructorDescriptionPreDefinedAuthenticator(boolean alwaysAllow) PreDefinedAuthenticator(String securePasscode, List<PreDefinedAuthenticator.AuthenticationToken> upfrontTokens) -
Method Summary
Modifier and TypeMethodDescriptionaddAuthentication(String name, UUID uuid, boolean needsApproval) Attempt to add authentication for user and UUID, if it fails to be added false will be returned.booleanauthenticate(String user, UUID uuid) Check if the user and UUID pair can connect to this board.booleandoesPasscodeMatch(String passcode) Checks if the provided passcode matches with the security passcode and returns false if it does not match.Gets a list of all apps/users stored in the systemIndicates how this authenticator can be edited, some don't support any, some remove only.voidremoveAuthentication(String user) Remove the authentication for the given user
-
Constructor Details
-
PreDefinedAuthenticator
public PreDefinedAuthenticator(boolean alwaysAllow) -
PreDefinedAuthenticator
public PreDefinedAuthenticator(String securePasscode, List<PreDefinedAuthenticator.AuthenticationToken> upfrontTokens)
-
-
Method Details
-
addAuthentication
Description copied from interface:MenuAuthenticatorAttempt to add authentication for user and UUID, if it fails to be added false will be returned.- Specified by:
addAuthenticationin interfaceMenuAuthenticator- Parameters:
name- the user to adduuid- the uuid associated with the userneedsApproval- true if this is being added from a remote connection and needs approval, otherwise false.- Returns:
- true if added, otherwise false.
-
removeAuthentication
Description copied from interface:MenuAuthenticatorRemove the authentication for the given user- Specified by:
removeAuthenticationin interfaceMenuAuthenticator- Parameters:
user- the user to remove
-
authenticate
Description copied from interface:MenuAuthenticatorCheck if the user and UUID pair can connect to this board.- Specified by:
authenticatein interfaceMenuAuthenticator- Parameters:
user- the user to check foruuid- the UUID to check for- Returns:
- true if the user and UUID are allowed, otherwise false
-
doesPasscodeMatch
Description copied from interface:MenuAuthenticatorChecks if the provided passcode matches with the security passcode and returns false if it does not match.- Specified by:
doesPasscodeMatchin interfaceMenuAuthenticator- Parameters:
passcode- the passcode to check- Returns:
- true if matching, otherwise false
-
managementCapabilities
Description copied from interface:MenuAuthenticatorIndicates how this authenticator can be edited, some don't support any, some remove only.- Specified by:
managementCapabilitiesin interfaceMenuAuthenticator- Returns:
- how the authenticator can be managed
-
getAllNames
Description copied from interface:MenuAuthenticatorGets a list of all apps/users stored in the system- Specified by:
getAllNamesin interfaceMenuAuthenticator- Returns:
- the list of users
-