OAuth2FeignRequestInterceptor 类在 Spring Boot 2.3 中已弃用 [英] OAuth2FeignRequestInterceptor class deprecated in Spring Boot 2.3

查看:28
本文介绍了OAuth2FeignRequestInterceptor 类在 Spring Boot 2.3 中已弃用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们最后的伪装客户端安全配置中,我们有这个 Bean:

In our last feign client security configuration we have this Bean:

    @Bean
    public RequestInterceptor oauth2FeignRequestInterceptor(
            ClientCredentialsResourceDetails oauth2RemoteResource) {
        return new OAuth2FeignRequestInterceptor(
                new DefaultOAuth2ClientContext(),
                oauth2RemoteResource
        );
    }

在 2.3 spring 版本中 OAuth2FeignRequestInterceptor 已弃用!但是我们找不到新的.

In 2.3 spring version OAuth2FeignRequestInterceptor is deprecated! But we cannot found the new one.

有人知道吗?

推荐答案

您可以创建自己的 RequestInterceptor 以添加 Authorization 标头.

You can create your own RequestInterceptor to add the Authorization header.

这里有一个例子:https://developer.okta.com/博客/2018/02/13/secure-spring-microservices-with-oauth

这篇关于OAuth2FeignRequestInterceptor 类在 Spring Boot 2.3 中已弃用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆