Class AuthenticationProvider

java.lang.Object
dev.adlin.vts4j.authentication.AuthenticationProvider

public class AuthenticationProvider extends Object
Authentication provider responsible for managing token requests.
  • Constructor Details

    • AuthenticationProvider

      public AuthenticationProvider()
  • Method Details

    • authenticateWithNewToken

      public @NonNull CompletableFuture<String> authenticateWithNewToken(@NonNull PluginMeta pluginMeta)
      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 CompletableFuture that 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 authenticated
      token - the existing authentication token string
      Returns:
      a CompletableFuture that completes when the authentication request succeeds