mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-18 01:46:44 +01:00
Add new authentication system
This commit is contained in:
17
src/main/java/emu/grasscutter/auth/Authenticator.java
Normal file
17
src/main/java/emu/grasscutter/auth/Authenticator.java
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user