Interface AuthenticationProvider

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface AuthenticationProvider
A provider for authentication credentials that supports token refresh.

Implement this interface to provide dynamic authentication tokens that can be refreshed when they expire. The SDK calls get() when the current token is about to expire.


 FliptClient.builder()
     .url("https://flipt.example.com")
     .authenticationProvider(() -> {
         Token token = myOAuthClient.getAccessToken();
         return AuthenticationLease.expiring(token.getExpiresAt())
             .jwt(token.getValue())
             .build();
     })
     .build();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Returns the current authentication credentials and their expiry time.