Interface CredentialsProvider

All Known Implementing Classes:
DefaultCredentialsProvider, OAuth2ClientCredentialsGrantCredentialsProvider, RefreshProtectedCredentialsProvider

public interface CredentialsProvider
Provider interface for establishing credentials for connecting to the broker. Especially useful for situations where credentials might expire or change before a recovery takes place or where it is convenient to plug in an outside custom implementation.
Since:
5.2.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Password/secret/token to use for authentication
    default Duration
    The time before the credentials expire, if they do expire.
    Username to use for authentication
    default void
    Instructs the provider to refresh or renew credentials.
  • Method Details

    • getUsername

      String getUsername()
      Username to use for authentication
      Returns:
      username
    • getPassword

      String getPassword()
      Password/secret/token to use for authentication
      Returns:
      password/secret/token
    • getTimeBeforeExpiration

      default Duration getTimeBeforeExpiration()
      The time before the credentials expire, if they do expire.

      If credentials do not expire, must return null. Default behavior is to return null, assuming credentials never expire.

      Returns:
      time before expiration
    • refresh

      default void refresh()
      Instructs the provider to refresh or renew credentials.

      Default behavior is no-op.