
[英]Custom Authentication Processing Filter Location in SecurityFilterChain?
我有一个AbstractAuthenticationProcessingFilter的自定义实现,我需要将其手动插入到安全过滤器链中。 我看过多个教程,每个教程都说要在链中的不同过滤器之前或之后插入它。 关于应该放置此过滤器的位置是否有明确的答案? 或者,至少,一个可以帮助解决问题的经验法则? 视 ...
[英]Custom Authentication Processing Filter Location in SecurityFilterChain?
我有一个AbstractAuthenticationProcessingFilter的自定义实现,我需要将其手动插入到安全过滤器链中。 我看过多个教程,每个教程都说要在链中的不同过滤器之前或之后插入它。 关于应该放置此过滤器的位置是否有明确的答案? 或者,至少,一个可以帮助解决问题的经验法则? 视 ...
[英]Why am I getting a 401 when using Spring Security 6, permitAll and after disabiling CSRF?
有一些类似的问题,所以我已尽力表示差异,但我已经审查过它们,但它们似乎与我的问题不符。 我有一些简单的用例...... 我尝试像这样使用 spring 安全性来让它工作...... 但是当我运行并尝试使用 GET 请求http://localhost:8080时,我仍然得到 401。如果我从 PO ...
[英]Using Auth0 in Spring Cloud Gateway, problem with getting ID Token
我们在使用 auth0 SDK 获取 ID 令牌时遇到问题。我们有基于 Spring 云网关(版本 3.1.4)的 API 网关,我们尝试使用您的 auth0 平台对用户进行身份验证,然后将交换路由到我们的微服务。 为此,我们想使用 ID Token 并从中获取 email 并将此 email 传递 ...
[英]Unit test returns 401 Unauthorized on a permitted route in Spring WebFlux Security
我正在尝试测试返回对象数组的路由,但测试失败,因为它返回 Unauthorized 而不是 200 OK 我的测试 class 而ApplicationSecurityConfig class,有一个SecurityWebFilterChain Bean JUint 测试错误显示如下 java. ...
[英]Spring OAuth2 Authorization Server + Spring WebFlux
我正在尝试使用Spring Boot 3.0.2和新发布Spring OAuth2 Authorization Server 1.0.0重写现有的 OAuth2 授权服务。 面临从 Reactive Security 和 Standard Security 库组合对象的问题:无法将默认安全应用于O ...
[英]How to use multiple login pages one for admin and the other one for user
我想要两个不同的登录页面。 一个供管理员使用,另一个供用户使用。 当我从 static 类中删除@Order注释时,仅使用带有@Order(1)的 class 下面的代码,只有最后一个有效。 我在两个不同的ConfigSecurity文件中使用了它们,但没有用。 我期待他们两个都能工作。 然而只有一 ...
[英]Spring Security -> SecurityConfig causes ERR_TOO_MANY_REDIRECTS
尝试访问我的 Spring SecurityConfig 中的登录页面时,是什么导致“ERROR_TOO_MANY_REDIRECTS” ? 我不确定问题是否出在SecurityConfig中,但这就是我的假设。 我将 Spring Boot 3.0.2 与 IntelliJ IDE Commun ...
[英]Oauth2 jwt token enriched with userinfo enpoint
我有一个公开一些 webflux 端点的 spring 应用程序,我使用 jwt 令牌来授权 post 调用,但我们还需要 userinfo 端点提供的信息。 我现在有一个 SecurityWebFilterChain bean,我们正在使用 oauth2ResourceServer 配置,然后调 ...
[英]Spring authorization server authenticate for each client
我正在尝试使用第三方应用程序将用于 FIM(联合身份管理)的 Spring 授权服务器构建身份提供者。 我们希望每个 OAuth 客户端都需要身份验证(如果用户尝试使用不同的客户端登录,则他们需要为每个客户端进行身份验证)。 开箱即用的流程如下所示: 所以有2个问题。 /oauth2/autho ...
[英]Spring boot: Requests with an expired Cookie is still available after logging out
在 spring 引导项目中,当用户注销时,我们使用以下代码块使 cookie 失效: 然而,在注销后,我用一个应用程序测试了我的网站,以捕获请求并通过中继器重新发送它,并使用准确的值,例如令牌和有效负载。 例如,我拒绝了更改 email 地址的请求,尽管已注销,但此请求在 15 分钟内有效(对于原 ...
[英]JWT in Cookies - do I need a refresh token?
我在后端使用 Spring Security 为我的 React SPA 实现安全性。 经过大量阅读,我选择了以下方法: HTTPS无处不在 POST /login 获取凭据以 cookie 形式返回 JWT_TOKEN 和 XSRF_TOKEN。 我自己构建 JWT_TOKEN,而 Sprin ...
[英]Spring boot - holding authenticated user through many server instances
我有基于JWT令牌的STATELESS安全无状态应用程序。 这是我的自定义授权过滤器override fun doFilterInternal( request: HttpServletRequest, response: HttpServletResponse, ...
[英]Spring security - using WebClient access a resource that is protected via Oauth2 "Password" grant type
赏金将在 6 天后到期。 此问题的答案有资格获得+50声望赏金。 tm1701想提请更多人注意这个问题。 如何使用 WebClient 访问受 Oauth2“密码”授权类型保护的资源? 连接 Oauth2 'client-credentials' 有效。 在这种情况下,我需要密码授予类型。 我收 ...
[英]Spring Boot 3 with Spring Security Intercepts exceptions I don't want it to
我正在使用 Spring Boot 3.0.2 和 Spring Security 构建一个 API,我已经构建了安全过滤器链,它在阻止未经身份验证的请求方面运行良好。 但是我有一个接受application/json的RestController class,如果我没有正确提供内容类型 heade ...
[英]Can I have Spring Boot create a WebClient which uses OAuth2 without it trying to apply the OAuth flow to my endpoints?
我想要一个使用 client_credentials OAuth2 流来授权 API 的 WebClient。我遵循了从文档到几个教程的各种说明。 我觉得我非常接近让 Spring Boot 做我想做的事,但默认行为是做我不想做的事——当我向我的任何控制器发出请求时,我被重定向到 /login。 ...
[英]Logout handler is hanging
我正在将工作应用程序从 Spring Boot 2.6.5 升级到 2.7.8 (Spring Security 5.7.6),以便我可以更好地升级到 3.0。 注销之前工作正常。 但是在升级到 Sprint Boot 2.7.8 之后,注销处理挂起并且永远不会重定向到logoutSuccessUr ...
[英]Getting 403 forbidden after authentication using custom authentication filter that parses JSON payload
我想要做的只是使用自定义身份验证过滤器对内存中的默认用户进行身份验证,该过滤器解析包含用户名和密码的 JSON 有效负载。 安全配置.javapackage ali.yousef.authdemo.config.security; @Configuration @EnableWebSecurit ...
[英]How do I use the BearerToken in all subsequent calls to the API after authenticating using username & password
我有一个 CustomAuthenticationProvider,它使用用户名和密码向 API 发出 POST 请求以进行身份验证,API 返回一个带有到期时间的访问令牌。 我在哪里设置这个令牌,所以只要用户登录,我就可以使用相同的令牌进一步调用 API。我还想在发出另一个请求之前验证令牌的到期 ...
[英]Cannot read client's X509 certificate in Spring Boot mTLS
我想在 mTLS 连接中读取客户端的 x509 证书。 我正在使用带有嵌入式 tomcat 的 Spring Boot。 我的WebSecurityConfig.java@Configuration @EnableWebSecurity public class WebSecurityConfig ...
[英]API requires JWT Token on all requests despite the authentication configuration
我正在尝试按照本教程(本教程的后续教程)为我的 API 实施 JWT 授权。当我尝试使用“/authenticate”和“/register”时,出现错误“JWT Token does not从 Bearer String 开始”。 这是抛出错误的请求过滤器的一部分: 这是应该允许“验证”和“请求” ...