io.github.slyang.cloud.feign.ApplyAuthHeaderFeignInterceptor Maven / Gradle / Ivy
package io.github.slyang.cloud.feign;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import io.github.slyang.web.security.token.TokenFetchHolder;
import lombok.extern.slf4j.Slf4j;
/**
* Description: 透传客户端调用的认证头信息
* Created by slyang
* Copyright (c) 2019, All Rights Reserved.
*/
@Slf4j
public class ApplyAuthHeaderFeignInterceptor implements RequestInterceptor {
@Override
public void apply(RequestTemplate requestTemplate) {
requestTemplate.header(TokenFetchHolder.TOKEN_FETCH.getAuthHeaderName(), TokenFetchHolder.TOKEN_FETCH.getToken());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy