Package dev.adlin.vts4j.authentication
Class AuthenticationProvider
java.lang.Object
dev.adlin.vts4j.authentication.AuthenticationProvider
Authentication provider responsible for managing token requests.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull CompletableFuture<Void> authenticateWithExistingToken(@NonNull PluginMeta pluginMeta, @NonNull String token) Authenticates a plugin using an already existing token.@NonNull CompletableFuture<String> authenticateWithNewToken(@NonNull PluginMeta pluginMeta) Performs a full authentication workflow for a plugin by generating a new token.
-
Constructor Details
-
AuthenticationProvider
public AuthenticationProvider()
-
-
Method Details
-
authenticateWithNewToken
Performs a full authentication workflow for a plugin by generating a new token.This method first requests a new authentication token and subsequently uses it to verify the plugin's authenticity.
- Parameters:
pluginMeta- the metadata of the plugin being authenticated- Returns:
- a
CompletableFuturethat resolves to the successfully issued and verified token string
-
authenticateWithExistingToken
public @NonNull CompletableFuture<Void> authenticateWithExistingToken(@NonNull PluginMeta pluginMeta, @NonNull String token) Authenticates a plugin using an already existing token.- Parameters:
pluginMeta- the metadata of the plugin being authenticatedtoken- the existing authentication token string- Returns:
- a
CompletableFuturethat completes when the authentication request succeeds
-