草庐IT

java - 使用 Spring Security,我如何使用 HTTP 方法(例如 GET、PUT、POST)来区分特定 URL 模式的安全性?

SpringSecurity引用声明:YoucanusemultipleelementstodefinedifferentaccessrequirementsfordifferentsetsofURLs,buttheywillbeevaluatedintheorderlistedandthefirstmatchwillbeused.Soyoumustputthemostspecificmatchesatthetop.YoucanalsoaddamethodattributetolimitthematchtoaparticularHTTPmethod(GET,POST,PUTetc.).

Spring Security 自定义过滤器(更改密码)

我正在使用SpringSecurity来保护对网站的HTTP请求。主要用途是保护页面,以便用户在尝试访问这些页面时被重定向到登录页面。不过,我还有一个要求。在我的模型中,我可以将用户的密码标记为临时密码,这样,当他们成功登录时,应该自动强制他们更改密码。更改密码后,应将其转发到他们最初尝试访问的页面。有没有人为此使用过SpringSecurity?我需要创建自己的自定义过滤器吗?谢谢,安德鲁 最佳答案 在SpringSecurity3.0中,您可以实现自定义AuthenticationSuccessHandler.在此处理程序中,您

Spring Security 自定义过滤器(更改密码)

我正在使用SpringSecurity来保护对网站的HTTP请求。主要用途是保护页面,以便用户在尝试访问这些页面时被重定向到登录页面。不过,我还有一个要求。在我的模型中,我可以将用户的密码标记为临时密码,这样,当他们成功登录时,应该自动强制他们更改密码。更改密码后,应将其转发到他们最初尝试访问的页面。有没有人为此使用过SpringSecurity?我需要创建自己的自定义过滤器吗?谢谢,安德鲁 最佳答案 在SpringSecurity3.0中,您可以实现自定义AuthenticationSuccessHandler.在此处理程序中,您

java - Spring Security,方法安全注释(@Secured)不起作用(java config)

我正在尝试使用@Secured("ADMIN")设置方法安全注释(没有任何XML,只有java配置,SpringBoot)。但是通过角色访问不起作用。安全配置:@Configuration@EnableWebSecuritypublicclassAppSecurityConfigurationextendsWebSecurityConfigurerAdapter{.....@Overrideprotectedvoidconfigure(HttpSecurityhttp)throwsException{http.authorizeRequests().antMatchers("/api/

java - Spring Security,方法安全注释(@Secured)不起作用(java config)

我正在尝试使用@Secured("ADMIN")设置方法安全注释(没有任何XML,只有java配置,SpringBoot)。但是通过角色访问不起作用。安全配置:@Configuration@EnableWebSecuritypublicclassAppSecurityConfigurationextendsWebSecurityConfigurerAdapter{.....@Overrideprotectedvoidconfigure(HttpSecurityhttp)throwsException{http.authorizeRequests().antMatchers("/api/

Spring Security HttpSecurity 配置测试

我有一个SpringBoot+SpringSecurity应用程序,它有几个antMatchers路径;一些fullyAuthenticated(),一些permitAll()。如何编写一个测试来验证SecurityConfiguration我的端点在/api/**下(以及最终其他)是否得到正确保护?publicclassSecurityConfigurationextendsWebSecurityConfigurerAdapter{protectedvoidconfigure(HttpSecurityhttp)throwsException{http//....antMatchers

Spring Security HttpSecurity 配置测试

我有一个SpringBoot+SpringSecurity应用程序,它有几个antMatchers路径;一些fullyAuthenticated(),一些permitAll()。如何编写一个测试来验证SecurityConfiguration我的端点在/api/**下(以及最终其他)是否得到正确保护?publicclassSecurityConfigurationextendsWebSecurityConfigurerAdapter{protectedvoidconfigure(HttpSecurityhttp)throwsException{http//....antMatchers

spring - 使用 Spring Security 集成单点登录

我正在使用SpringSecurity,我想使用另一个站点作为我的身份验证提供程序之一。我在我的网站上有一个基于基本表单的登录。我想在我的网站上有一个链接,将用户带到他们将登录的外部网站,然后该外部网站将向我发布一个xml响应,其中包含我可以验证的数据以查看是否成功登录。任何帮助将不胜感激!如何将该流程集成到SpringSecurity中?收到回复后,如何自动登录用户?使用以下指南的示例:过滤器(未显示我的数据来自请求的xml):publicclassXMLAuthenticationFilterextendsAbstractAuthenticationProcessingFilter

spring - 使用 Spring Security 集成单点登录

我正在使用SpringSecurity,我想使用另一个站点作为我的身份验证提供程序之一。我在我的网站上有一个基于基本表单的登录。我想在我的网站上有一个链接,将用户带到他们将登录的外部网站,然后该外部网站将向我发布一个xml响应,其中包含我可以验证的数据以查看是否成功登录。任何帮助将不胜感激!如何将该流程集成到SpringSecurity中?收到回复后,如何自动登录用户?使用以下指南的示例:过滤器(未显示我的数据来自请求的xml):publicclassXMLAuthenticationFilterextendsAbstractAuthenticationProcessingFilter

spring security 没有找到 WebApplicationContext

我是SpringSecurity新手我有web.xmlcontextConfigLocation/WEB-INF/applicationContext-security.xmlspringorg.springframework.web.servlet.DispatcherServlet1spring*.htmlspringSecurityFilterChainorg.springframework.web.filter.DelegatingFilterProxyspringSecurityFilterChain/*index.htmlapplicationContext-securit