Package io.flipt.client.models
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.
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 TypeMethodDescriptionget()Returns the current authentication credentials and their expiry time.
-
Method Details
-
get
AuthenticationLease get()Returns the current authentication credentials and their expiry time.- Returns:
- an
AuthenticationLeasecontaining the credential and expiry
-