大佬教程收集整理的这篇文章主要介绍了如何为 DelegatingOauth2TokenValidator<>(withIssuer, AudienceValidator ),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我们在我们的一项服务中集成了 Oauth2 库。我们正在创建 jwtDecoder 如下:
@Bean
JwtDecoder jwtDecoder() {
NimbusJwtDecoder jwtDecoder = (NimbusJwtDecoder)
JwtDecoders.fromIssuerLOCATIOn(issuerUri);
OAuth2TokenValIDator<Jwt> withClockSkew = new DelegaTingOAuth2TokenValIDator<>(
new JwttimestampValIDator(Duration.ofSeconds(60)),new JwtIssuerValIDator(issuerUri));
jwtDecoder.setJwtValIDator(withClockSkew);
return jwtDecoder;
}
'issuerUri' 是来自属性的 okta 端点。现在,当我在我们的 openshift pod 中部署相同的内容时,出现“拒绝连接”错误。
我不允许为此提出防火墙访问请求。我所能做的就是使用代理。
为了使用代理,我创建了一个restTemplate bean,如下所示:
@Bean
public RestTemplate restTemplate() {
SimpleClIEnthttprequestFactory requestFactory = new SimpleClIEnthttprequestFactory();
Proxy proxy = new Proxy(Type.http,new InetSocketAddress("my.host.com",8080));
requestFactory.setProxy(proxy);
return new RestTemplate(requestFactory);
}
还有,
添加的属性如下:
http.proxyHost = "xxx",http.proxyPort = xxxx
仍然,我看到了同样的错误。
有没有办法向 issuerUri 添加代理?
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的如何为 DelegatingOauth2TokenValidator<>(withIssuer, AudienceValidator )全部内容,希望文章能够帮你解决如何为 DelegatingOauth2TokenValidator<>(withIssuer, AudienceValidator )所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。