
com.chavaillaz.client.common.security.TokenAuthentication Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-client Show documentation
Show all versions of common-client Show documentation
Library for the creation of asynchronous clients supporting multiple HTTP clients
package com.chavaillaz.client.common.security;
import java.util.function.BiConsumer;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* Token authentication, adding {@code Authorization} header with it.
*/
@Getter
@RequiredArgsConstructor
public class TokenAuthentication extends AnonymousAuthentication {
private final String token;
@Override
public void fillHeaders(BiConsumer addHeader) {
addHeader.accept("Authorization", "Bearer " + getToken());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy