Add new authentication system

This commit is contained in:
KingRainbow44
2022-05-13 11:38:17 -04:00
parent 0b21a43900
commit 39f23a0c47
4 changed files with 319 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
package emu.grasscutter.auth;
import emu.grasscutter.server.http.objects.*;
/**
* Handles username/password authentication from the client.
* @param <T> The response object type. Should be {@link LoginResultJson} or {@link ComboTokenResJson}
*/
public interface Authenticator<T> {
/**
* Attempt to authenticate the client with the provided credentials.
* @param request The authentication request wrapped in a {@link AuthenticationSystem.AuthenticationRequest} object.
* @return The result of the login in an object.
*/
T authenticate(AuthenticationSystem.AuthenticationRequest request);
}