Package emu.grasscutter.auth
Class DefaultAuthentication
java.lang.Object
emu.grasscutter.auth.DefaultAuthentication
- All Implemented Interfaces:
AuthenticationSystem
The default Grasscutter authentication implementation.
Allows all users to access any account.
-
Nested Class Summary
Nested classes/interfaces inherited from interface emu.grasscutter.auth.AuthenticationSystem
AuthenticationSystem.AuthenticationRequest -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateAccount(String username, String password) Called when a user requests to make an account.This is the authenticator used for handling external authentication requests.This is the authenticator used for handling OAuth authentication requests.This is the authenticator used for password authentication.This is the authenticator used for session authentication.This is the authenticator used for token authentication.voidresetPassword(String username) Called when a user requests to reset their password.verifyUser(String details) Called by plugins to internally verify a user's identity.
-
Constructor Details
-
DefaultAuthentication
public DefaultAuthentication()
-
-
Method Details
-
createAccount
Description copied from interface:AuthenticationSystemCalled when a user requests to make an account.- Specified by:
createAccountin interfaceAuthenticationSystem- Parameters:
username- The provided username.password- The provided password. (SHA-256'ed)
-
resetPassword
Description copied from interface:AuthenticationSystemCalled when a user requests to reset their password.- Specified by:
resetPasswordin interfaceAuthenticationSystem- Parameters:
username- The username of the account to reset.
-
verifyUser
Description copied from interface:AuthenticationSystemCalled by plugins to internally verify a user's identity.- Specified by:
verifyUserin interfaceAuthenticationSystem- Parameters:
details- A unique identifier to identify the user. (For example: a JWT token)- Returns:
- The user's account if the verification was successful, null if the user was unable to be verified.
-
getPasswordAuthenticator
Description copied from interface:AuthenticationSystemThis is the authenticator used for password authentication.- Specified by:
getPasswordAuthenticatorin interfaceAuthenticationSystem- Returns:
- An authenticator.
-
getTokenAuthenticator
Description copied from interface:AuthenticationSystemThis is the authenticator used for token authentication.- Specified by:
getTokenAuthenticatorin interfaceAuthenticationSystem- Returns:
- An authenticator.
-
getSessionKeyAuthenticator
Description copied from interface:AuthenticationSystemThis is the authenticator used for session authentication.- Specified by:
getSessionKeyAuthenticatorin interfaceAuthenticationSystem- Returns:
- An authenticator.
-
getExternalAuthenticator
Description copied from interface:AuthenticationSystemThis is the authenticator used for handling external authentication requests.- Specified by:
getExternalAuthenticatorin interfaceAuthenticationSystem- Returns:
- An authenticator.
-
getOAuthAuthenticator
Description copied from interface:AuthenticationSystemThis is the authenticator used for handling OAuth authentication requests.- Specified by:
getOAuthAuthenticatorin interfaceAuthenticationSystem- Returns:
- An authenticator.
-