且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么要使用j_username和SPRING_SECURITY_LAST_USERNAME变量?

更新时间:2023-12-03 20:09:34

j_username j_password 是Java Servlet中的标准化名称规范,因此应用程序服务器(或servlet容器)了解它们,并且可以独立于应用程序执行容器身份验证。这允许例如单点登录到在同一应用服务器中部署的多个webapp。请参阅 JSR-154 中的SRV 12.5.3基于表单的身份验证一章。

j_username and j_password are standardized names in the Java Servlet specification, so the application servers (or servlet containers) know about them and can perform container authentication, independently of the application. This allows for example single-sign on into multiple webapps deployed in the same application server. See chapter "SRV 12.5.3 Form Based Authentication" in JSR-154

Spring Security常量只是为用户提供便利,因此他们不必重新输入用户名,如果Spring Security认出它们会自动建议用户名。

The Spring Security constant is just a convenience for users, so they don't have to re-enter their username, if Spring Security recognizes them it automatically suggests the username.