Class AuthHandler
java.lang.Object
pro.gravit.launchserver.auth.handler.AuthHandler
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
CachedAuthHandler,NullAuthHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic pro.gravit.utils.ProviderMap<AuthHandler>protected LaunchServer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract UUIDauth(AuthProviderResult authResult)Returns the UUID associated with the accountstatic UUIDabstract UUIDcheckServer(String username, String serverID)Validates serverIDabstract voidclose()voidinit(LaunchServer srv)abstract booleanjoinServer(String username, String accessToken, String serverID)Checks assessToken for validity and saves serverID if successfulstatic voidabstract UUIDusernameToUUID(String username)abstract StringuuidToUsername(UUID uuid)
-
Field Details
-
providers
-
srv
-
-
Constructor Details
-
AuthHandler
public AuthHandler()
-
-
Method Details
-
authError
- Throws:
AuthException
-
registerHandlers
public static void registerHandlers() -
auth
Returns the UUID associated with the account- Parameters:
authResult-AuthProviderresult- Returns:
- User UUID
- Throws:
IOException- Internal Script Error
-
checkServer
Validates serverID- Parameters:
username- user nameserverID- serverID to check- Returns:
- user UUID
- Throws:
IOException- Internal Script Error
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
joinServer
public abstract boolean joinServer(String username, String accessToken, String serverID) throws IOExceptionChecks assessToken for validity and saves serverID if successful- Parameters:
username- user nameaccessToken- assessToken to checkserverID- serverID to save- Returns:
- true - allow, false - deny
- Throws:
IOException- Internal Script Error
-
usernameToUUID
- Throws:
IOException
-
uuidToUsername
- Throws:
IOException
-
init
-