All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.chavaillaz.client.common.security.TokenAuthentication Maven / Gradle / Ivy

Go to download

Library for the creation of asynchronous clients supporting multiple HTTP clients

There is a newer version: 2.1.3
Show newest version
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