gpt4 book ai didi

spring-boot - 是否有使用 WebFlux 的 OAuth2 工作示例

转载 作者:行者123 更新时间:2023-12-03 15:04:07 25 4
gpt4 key购买 nike

我正在尝试将 OAuth2 添加到 WebFlux,但找不到任何工作示例。

为了实现自己的授权服务器,我使用了这样的代码:

@EnableAuthorizationServer
@Configuration
public class ServerAuth extends AuthorizationServerConfigurerAdapter {
...
}

我的 Spring Boot 应用程序停止工作,因为在内部 AuthorizationServerConfigurerAdapter 类有 的用法AuthorizationServerSecurityConfigurer 这取决于 javax.servlet.Filter 但是在 WebFlux 应用程序中,没有 Servlet 过滤器。

还有 AuthorizationServerEndpointsConfigurer 期望用 初始化用户详细信息服务 (旧的非 react 性 api)非 react 性 UserDetailsRepository

是否可以在当前的 WebFlux 应用程序中使用 oauth2,如果可以,您可以展示示例。

谢谢

最佳答案

授权服务器 webflux 支持尚未由 spring 安全团队实现。

目前,他们拥有资源服务器 webflux 支持,如提到的其他答案。然而,他们在这里提到他们正在授权服务器上工作,基于此,它应该很快就会出来:

The OAuth 2.0 support is currently underway in Spring Security 5 with new Client support. The plan is to also provide support for Resource Server by mid-2018 and Authorization Server by the end of 2018 or early 2019. Our goal is to provide extensive support for OAuth 2.0 Core and Extensions, OpenID Connect 1.0, and Javascript Object Signing and Encryption (JOSE).



来源: https://spring.io/blog/2018/01/30/next-generation-oauth-2-0-support-with-spring-security

所以现在我们被困在 servlet OAuth2 服务器上,如果你问我的话,如果你使用 JWT token 应该足够好。

干杯!

关于spring-boot - 是否有使用 WebFlux 的 OAuth2 工作示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46798705/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com