Authenticator.java 627 Bytes
Newer Older
KingRainbow44's avatar
KingRainbow44 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);
}