Interface BearerTokenProvider

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
FileBearerTokenProvider, StaticBearerTokenProvider

public interface BearerTokenProvider extends AutoCloseable
Interface for providing bearer tokens for authentication.

Implementations can provide tokens from various sources such as:

  • Static string values
  • Files (with automatic reloading)
  • External token services
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Clean up any resources used by this token provider.
    Get the current bearer token.
  • Method Details

    • getToken

      @Nullable String getToken()
      Get the current bearer token.
      Returns:
      the bearer token, or null if no token is available
    • close

      default void close()
      Clean up any resources used by this token provider. Should be called when the provider is no longer needed.
      Specified by:
      close in interface AutoCloseable