Class JwtAuthenticationHeaderProvider
java.lang.Object
io.github.evisentin.wordpress.client.domain.auth.header.JwtAuthenticationHeaderProvider
- All Implemented Interfaces:
AuthenticationHeaderProvider<WpJwtAuthenticationStrategy>
public final class JwtAuthenticationHeaderProvider
extends Object
implements AuthenticationHeaderProvider<WpJwtAuthenticationStrategy>
Creates JWT bearer
Authorization headers.
This provider fetches a JWT token using a JwtTokenClient, caches it, and reuses it until it expires.
Token refresh is synchronized to avoid duplicate token requests when accessed concurrently.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateAuthorizationHeader(@NonNull WpJwtAuthenticationStrategy strategy) Creates the value of an HTTPAuthorizationheader.
-
Constructor Details
-
JwtAuthenticationHeaderProvider
-
-
Method Details
-
createAuthorizationHeader
Description copied from interface:AuthenticationHeaderProviderCreates the value of an HTTPAuthorizationheader.- Specified by:
createAuthorizationHeaderin interfaceAuthenticationHeaderProvider<WpJwtAuthenticationStrategy>- Parameters:
strategy- authentication strategy to use- Returns:
- authorization header value
-