草庐IT

SECURITY_PRINCIPAL

全部标签

java - @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER) 与 Spring Security 中的 ManagementServerProperties.ACCESS_OVERRIDE_ORDER

问题1:在SpringSecurity中,函数到底是什么@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)Spring文档说明了以下内容,但我不确定我是否理解清楚Tooverridetheaccessruleswithoutchanginganyotherautoconfiguredfeaturesadda@BeanoftypeWebSecurityConfigurerAdapterwith@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER).根据我的理解,SpringSecurity中各种安全特

java - Spring Security 自定义登录错误

我一直在尝试将SpringSecurityCustomLogin(JavaConfig)添加到我的应用程序中,但不断弹出一个奇怪的错误。我已经通过CreatingaCustomLoginFormtutorial它工作得很好。我不确定我的应用程序有什么问题。错误Causedby:java.lang.IllegalArgumentException:'login?error'isnotavalidredirectURL安全配置@Configuration@EnableWebSecuritypublicclassSecurityConfigextendsWebSecurityConfigur

spring - Spring 4.0 + Security 3.2 + j_spring_security_check 的 JavaConfiguration

创建登录页面TestLogin"method="POST">Username Password  Failedtologin.Reason:声明一个WebSecurityConfigurer这里是我缺少j_username和j_password的地方@Configuration@EnableWebSecurity@ComponentScan(basePackages={"com.sample.init.security"})publicclassWebSecurityConfigurerextendsWebSecurityConfigurerAdapter

spring - spring security 3.1中根据角色确定目标url

在springsecurity3.0中,我们有AuthenticationProcessingFilter类,我们在其中使用determineTargetUrl()方法,该方法根据不同的角色返回url。现在,我们正在迁移到springsecurity3.1.0.RC3,我被困住了,我现在应该如何根据不同的角色确定url,因为AuthenticationProcessingFilter类已从新版本中删除。谁能给我一些代码的简要步骤,以便我可以实现自定义过滤器以重定向到不同角色的不同页面。 最佳答案 根据角色确定目标url的最佳方法是在

spring - 如何在 Spring Security 中找到用户的 IP?

我需要找到那些登录我们应用程序的用户。我们正在使用SpringSecurity,必须有办法找出用户的IP。我认为这些信息都存储在他们的session中。在SpringSecurity中,当前session存储在SessionRegistry.从这个类中,我可以获得经过身份验证的用户列表和一些session信息。(使用getAllPrincipals、getAllSessions和getSessionInformation)问题是,我怎样才能访问当前用户的IP?考虑到我们必须只为已知区域提供服务。SessionInformation没有太大帮助,因为它不包含太多信息。

Spring安全认证: get username without SPRING_SECURITY_LAST_USERNAME

我是Spring框架的新手。我正在为我的web应用程序创建一个登录页面,并且我希望用户在对应用程序进行任何操作之前登录。如果用户输入了良好的凭据,一切都可以正常工作,但是如果输入错误的凭据,我想显示一条消息并将用户名保留在输入元素上。显示消息不是问题,但如果不使用已弃用的变量SPRING_SECURITY_LAST_USERNAME,我无法将用户名保留在我的jps文件中。希望有人可以帮助我,我正在使用Spring3。更新:要求说我不想在url上显示用户名。 最佳答案 已弃用常量的文档准确地说明了您应该做什么:/***@depreca

Spring Security Invalid remember-me token (Series/token) 不匹配。暗示先前的 cookie 盗窃攻击

我有一个使用SpringSecurity3.1.2在tomcat7中运行的GWT应用程序。我正在使用UsernamePasswordAuthenticationFilter和PersistentTokenBasedRememberMeServices在数据库上持久登录。此外,我也在使用tomcatPersistentManager将session保存在数据库中。现在我的问题是,每次我尝试登录时,我都会得到Invalidremember-metoken(Series/token)mismatchCookieTheftException(我在下面添加了堆栈)。我尝试从tomcat_sess

spring - 使用 Spring Security 和 Firebase 身份验证的 REST 服务

是否有一种简单的方法可以将Firebase身份验证与SpringSecurity集成(用于REST服务)?根据我的阅读,我可能需要使用JWTtoken(通过Firebase获得),使用它来验证Spring服务,最后通过Firebase在服务中验证token。但是我找不到任何(简单的)关于将JWT与SpringSecurity结合使用的文档。我还希望能够提供一个使用基本身份验证而不是JWT的/auth/login端点,以便我可以使用电子邮件/密码凭据通过Firebase获取JWTtoken。但这意味着在服务的一个端点启用基本身份验证,在所有其他端点启用JWT身份验证。不确定这是否可能。

Spring Boot/Spring Security AuthenticationEntryPoint 未执行

我创建了一个包含此方法的类JwtAuthenticationFilter:@OverridepublicAuthenticationattemptAuthentication(HttpServletRequestrequest,HttpServletResponseresponse)throwsAuthenticationException{Authenticationauthentication=null;if(hasJsonToken(request)){JwtAuthenticationTokenjwtAuthenticationToken=newJwtAuthenticatio

java - spring security - 有没有办法在我的应用程序中获取 session 注册表(无需显式自定义并发过滤器)

我指的是this线程,并在RobWinch的倒数第二篇文章中(SpringSecurityLead),他提到我们可以访问sessionRegisty:因此,我注册了HttpSessionEventPublisher过滤web.xml并在我的中指定上述设置部分。我不要添加这个:在我的类里面,我像这样注入(inject)sessionRegistry的一个实例:@AutowiredprivateSessionRegistrysessionRegistry这就是我试图找出用户session的方式:ListuserSessions=sessionRegistry.getAllSessions(