mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-02-06 18:17:00 +01:00
Add OAuth in AuthenticationSystem
This commit is contained in:
@@ -60,6 +60,12 @@ public interface AuthenticationSystem {
|
||||
*/
|
||||
ExternalAuthenticator getExternalAuthenticator();
|
||||
|
||||
/**
|
||||
* This is the authenticator used for handling OAuth authentication requests.
|
||||
* @return An authenticator.
|
||||
*/
|
||||
OAuthAuthenticator getOAuthAuthenticator();
|
||||
|
||||
/**
|
||||
* A data container that holds relevant data for authenticating a client.
|
||||
*/
|
||||
@@ -125,4 +131,16 @@ public interface AuthenticationSystem {
|
||||
return AuthenticationRequest.builder().request(request)
|
||||
.response(response).build();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates an authentication request from a {@link Response} object.
|
||||
* @param request The Express request.
|
||||
* @param jsonData The JSON data.
|
||||
* @return An authentication request.
|
||||
*/
|
||||
static AuthenticationRequest fromOAuthRequest(Request request, Response response) {
|
||||
return AuthenticationRequest.builder().request(request)
|
||||
.response(response).build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user