SEC-562: Changed urls for login, logout, switch user etc.
This commit is contained in:
parent
c150e25c15
commit
5066fc5e39
|
@ -104,7 +104,7 @@ public class HttpSessionContextIntegrationFilter implements InitializingBean, Fi
|
|||
|
||||
protected static final Log logger = LogFactory.getLog(HttpSessionContextIntegrationFilter.class);
|
||||
|
||||
static final String FILTER_APPLIED = "__acegi_session_integration_filter_applied";
|
||||
static final String FILTER_APPLIED = "__spring_security_session_integration_filter_applied";
|
||||
|
||||
public static final String SPRING_SECURITY_CONTEXT_KEY = "SPRING_SECURITY_CONTEXT";
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class SecurityContextHolder {
|
|||
public static final String MODE_THREADLOCAL = "MODE_THREADLOCAL";
|
||||
public static final String MODE_INHERITABLETHREADLOCAL = "MODE_INHERITABLETHREADLOCAL";
|
||||
public static final String MODE_GLOBAL = "MODE_GLOBAL";
|
||||
public static final String SYSTEM_PROPERTY = "acegi.security.strategy";
|
||||
public static final String SYSTEM_PROPERTY = "spring.security.strategy";
|
||||
private static String strategyName = System.getProperty(SYSTEM_PROPERTY);
|
||||
private static SecurityContextHolderStrategy strategy;
|
||||
private static int initializeCount = 0;
|
||||
|
|
|
@ -41,7 +41,7 @@ import javax.servlet.ServletResponse;
|
|||
public class FilterSecurityInterceptor extends AbstractSecurityInterceptor implements Filter {
|
||||
//~ Static fields/initializers =====================================================================================
|
||||
|
||||
private static final String FILTER_APPLIED = "__acegi_filterSecurityInterceptor_filterApplied";
|
||||
private static final String FILTER_APPLIED = "__acegi_security_filterSecurityInterceptor_filterApplied";
|
||||
|
||||
//~ Instance fields ================================================================================================
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ public abstract class AbstractProcessingFilter implements Filter, InitializingBe
|
|||
|
||||
/**
|
||||
* The URL destination that this filter intercepts and processes (usually
|
||||
* something like <code>/j_acegi_security_check</code>)
|
||||
* something like <code>/j_spring_security_check</code>)
|
||||
*/
|
||||
private String filterProcessesUrl = getDefaultFilterProcessesUrl();
|
||||
|
||||
|
|
|
@ -77,12 +77,12 @@ public class CasProcessingFilter extends AbstractProcessingFilter {
|
|||
}
|
||||
|
||||
/**
|
||||
* This filter by default responds to <code>/j_acegi_cas_security_check</code>.
|
||||
* This filter by default responds to <code>/j_spring_cas_security_check</code>.
|
||||
*
|
||||
* @return the default
|
||||
*/
|
||||
public String getDefaultFilterProcessesUrl() {
|
||||
return "/j_acegi_cas_security_check";
|
||||
return "/j_spring_cas_security_check";
|
||||
}
|
||||
|
||||
public void init(FilterConfig filterConfig) throws ServletException {}
|
||||
|
|
|
@ -43,7 +43,7 @@ public class ServiceProperties implements InitializingBean {
|
|||
/**
|
||||
* Represents the service the user is authenticating to.<p>This service is the callback URL belonging to
|
||||
* the local Acegi Security System for Spring secured application. For example,</p>
|
||||
* <code>https://www.mycompany.com/application/j_acegi_cas_security_check</code>
|
||||
* <code>https://www.mycompany.com/application/j_spring_cas_security_check</code>
|
||||
*
|
||||
* @return the URL of the service the user is authenticating to
|
||||
*/
|
||||
|
|
|
@ -58,7 +58,7 @@ public class LogoutFilter implements Filter {
|
|||
|
||||
//~ Instance fields ================================================================================================
|
||||
|
||||
private String filterProcessesUrl = "/j_acegi_logout";
|
||||
private String filterProcessesUrl = "/j_spring_security_logout";
|
||||
private String logoutSuccessUrl;
|
||||
private LogoutHandler[] handlers;
|
||||
private boolean useRelativeContext;
|
||||
|
|
|
@ -87,8 +87,8 @@ import javax.servlet.http.HttpServletResponse;
|
|||
* Example:<pre>
|
||||
* <bean id="switchUserProcessingFilter" class="org.springframework.security.ui.switchuser.SwitchUserProcessingFilter">
|
||||
* <property name="authenticationDao" ref="jdbcDaoImpl" />
|
||||
* <property name="switchUserUrl"><value>/j_acegi_switch_user</value></property>
|
||||
* <property name="exitUserUrl"><value>/j_acegi_exit_user</value></property>
|
||||
* <property name="switchUserUrl"><value>/j_spring_security_switch_user</value></property>
|
||||
* <property name="exitUserUrl"><value>/j_spring_security_exit_user</value></property>
|
||||
* <property name="targetUrl"><value>/index.jsp</value></property></bean></pre></p>
|
||||
*
|
||||
* @author Mark St.Godard
|
||||
|
@ -112,8 +112,8 @@ public class SwitchUserProcessingFilter implements Filter, InitializingBean, App
|
|||
private ApplicationEventPublisher eventPublisher;
|
||||
private AuthenticationDetailsSource authenticationDetailsSource = new AuthenticationDetailsSourceImpl();
|
||||
protected MessageSourceAccessor messages = AcegiMessageSource.getAccessor();
|
||||
private String exitUserUrl = "/j_acegi_exit_user";
|
||||
private String switchUserUrl = "/j_acegi_switch_user";
|
||||
private String exitUserUrl = "/j_spring_security_exit_user";
|
||||
private String switchUserUrl = "/j_spring_security_switch_user";
|
||||
private String targetUrl;
|
||||
private SwitchUserAuthorityChanger switchUserAuthorityChanger;
|
||||
|
||||
|
|
|
@ -82,12 +82,12 @@ public class AuthenticationProcessingFilter extends AbstractProcessingFilter {
|
|||
}
|
||||
|
||||
/**
|
||||
* This filter by default responds to <code>/j_acegi_security_check</code>.
|
||||
* This filter by default responds to <code>/j_spring_security_check</code>.
|
||||
*
|
||||
* @return the default
|
||||
*/
|
||||
public String getDefaultFilterProcessesUrl() {
|
||||
return "/j_acegi_security_check";
|
||||
return "/j_spring_security_check";
|
||||
}
|
||||
|
||||
public void init(FilterConfig filterConfig) throws ServletException {}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class PopulatedDatabase {
|
|||
private static void setupDataSource() {
|
||||
dataSource = new DriverManagerDataSource();
|
||||
dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
|
||||
dataSource.setUrl("jdbc:hsqldb:mem:acegisecuritytest");
|
||||
dataSource.setUrl("jdbc:hsqldb:mem:springsecuritytest");
|
||||
dataSource.setUsername("sa");
|
||||
dataSource.setPassword("");
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ public class CasAuthenticationProviderTests extends TestCase {
|
|||
assertEquals(makeUserDetailsFromAuthoritiesPopulator(), casResult.getPrincipal());
|
||||
assertEquals("PGTIOU-0-R0zlgrl4pdAQwBvJWO3vnNpevwqStbSGcq3vKB2SqSFFRnjPHt",
|
||||
casResult.getProxyGrantingTicketIou());
|
||||
assertEquals("https://localhost/portal/j_acegi_cas_security_check", casResult.getProxyList().get(0));
|
||||
assertEquals("https://localhost/portal/j_spring_cas_security_check", casResult.getProxyList().get(0));
|
||||
assertEquals("ST-123", casResult.getCredentials());
|
||||
assertEquals(new GrantedAuthorityImpl("ROLE_A"), casResult.getAuthorities()[0]);
|
||||
assertEquals(new GrantedAuthorityImpl("ROLE_B"), casResult.getAuthorities()[1]);
|
||||
|
@ -393,7 +393,7 @@ public class CasAuthenticationProviderTests extends TestCase {
|
|||
throws AuthenticationException {
|
||||
if (returnTicket) {
|
||||
List list = new Vector();
|
||||
list.add("https://localhost/portal/j_acegi_cas_security_check");
|
||||
list.add("https://localhost/portal/j_spring_cas_security_check");
|
||||
|
||||
return new TicketResponse("marissa", list, "PGTIOU-0-R0zlgrl4pdAQwBvJWO3vnNpevwqStbSGcq3vKB2SqSFFRnjPHt");
|
||||
}
|
||||
|
|
|
@ -140,14 +140,14 @@ public class CasAuthenticationTokenTests extends TestCase {
|
|||
|
||||
public void testEqualsWhenEqual() {
|
||||
List proxyList1 = new Vector();
|
||||
proxyList1.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList1.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
CasAuthenticationToken token1 = new CasAuthenticationToken("key", makeUserDetails(), "Password",
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")},
|
||||
makeUserDetails(), proxyList1, "PGTIOU-0-R0zlgrl4pdAQwBvJWO3vnNpevwqStbSGcq3vKB2SqSFFRnjPHt");
|
||||
|
||||
List proxyList2 = new Vector();
|
||||
proxyList2.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList2.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
CasAuthenticationToken token2 = new CasAuthenticationToken("key", makeUserDetails(), "Password",
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")},
|
||||
|
@ -159,7 +159,7 @@ public class CasAuthenticationTokenTests extends TestCase {
|
|||
public void testGetters() {
|
||||
// Build the proxy list returned in the ticket from CAS
|
||||
List proxyList = new Vector();
|
||||
proxyList.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
CasAuthenticationToken token = new CasAuthenticationToken("key", makeUserDetails(), "Password",
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")},
|
||||
|
@ -187,14 +187,14 @@ public class CasAuthenticationTokenTests extends TestCase {
|
|||
|
||||
public void testNotEqualsDueToAbstractParentEqualsCheck() {
|
||||
List proxyList1 = new Vector();
|
||||
proxyList1.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList1.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
CasAuthenticationToken token1 = new CasAuthenticationToken("key", makeUserDetails(), "Password",
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")},
|
||||
makeUserDetails(), proxyList1, "PGTIOU-0-R0zlgrl4pdAQwBvJWO3vnNpevwqStbSGcq3vKB2SqSFFRnjPHt");
|
||||
|
||||
List proxyList2 = new Vector();
|
||||
proxyList2.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList2.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
CasAuthenticationToken token2 = new CasAuthenticationToken("key", makeUserDetails("OTHER_NAME"), "Password",
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")},
|
||||
|
@ -205,7 +205,7 @@ public class CasAuthenticationTokenTests extends TestCase {
|
|||
|
||||
public void testNotEqualsDueToDifferentAuthenticationClass() {
|
||||
List proxyList1 = new Vector();
|
||||
proxyList1.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList1.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
CasAuthenticationToken token1 = new CasAuthenticationToken("key", makeUserDetails(), "Password",
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")},
|
||||
|
@ -219,14 +219,14 @@ public class CasAuthenticationTokenTests extends TestCase {
|
|||
|
||||
public void testNotEqualsDueToKey() {
|
||||
List proxyList1 = new Vector();
|
||||
proxyList1.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList1.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
CasAuthenticationToken token1 = new CasAuthenticationToken("key", makeUserDetails(), "Password",
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")},
|
||||
makeUserDetails(), proxyList1, "PGTIOU-0-R0zlgrl4pdAQwBvJWO3vnNpevwqStbSGcq3vKB2SqSFFRnjPHt");
|
||||
|
||||
List proxyList2 = new Vector();
|
||||
proxyList2.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList2.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
CasAuthenticationToken token2 = new CasAuthenticationToken("DIFFERENT_KEY", makeUserDetails(), "Password",
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")},
|
||||
|
@ -237,14 +237,14 @@ public class CasAuthenticationTokenTests extends TestCase {
|
|||
|
||||
public void testNotEqualsDueToProxyGrantingTicket() {
|
||||
List proxyList1 = new Vector();
|
||||
proxyList1.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList1.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
CasAuthenticationToken token1 = new CasAuthenticationToken("key", makeUserDetails(), "Password",
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")},
|
||||
makeUserDetails(), proxyList1, "PGTIOU-0-R0zlgrl4pdAQwBvJWO3vnNpevwqStbSGcq3vKB2SqSFFRnjPHt");
|
||||
|
||||
List proxyList2 = new Vector();
|
||||
proxyList2.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList2.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
CasAuthenticationToken token2 = new CasAuthenticationToken("key", makeUserDetails(), "Password",
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")},
|
||||
|
@ -255,14 +255,14 @@ public class CasAuthenticationTokenTests extends TestCase {
|
|||
|
||||
public void testNotEqualsDueToProxyList() {
|
||||
List proxyList1 = new Vector();
|
||||
proxyList1.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList1.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
CasAuthenticationToken token1 = new CasAuthenticationToken("key", makeUserDetails(), "Password",
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")},
|
||||
makeUserDetails(), proxyList1, "PGTIOU-0-R0zlgrl4pdAQwBvJWO3vnNpevwqStbSGcq3vKB2SqSFFRnjPHt");
|
||||
|
||||
List proxyList2 = new Vector();
|
||||
proxyList2.add("https://localhost/SOME_OTHER_PORTAL/j_acegi_cas_security_check");
|
||||
proxyList2.add("https://localhost/SOME_OTHER_PORTAL/j_spring_cas_security_check");
|
||||
|
||||
CasAuthenticationToken token2 = new CasAuthenticationToken("key", makeUserDetails(), "Password",
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")},
|
||||
|
|
|
@ -71,7 +71,7 @@ public class TicketResponseTests extends TestCase {
|
|||
public void testGetters() {
|
||||
// Build the proxy list returned in the ticket from CAS
|
||||
List proxyList = new Vector();
|
||||
proxyList.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
TicketResponse ticket = new TicketResponse("marissa", proxyList,
|
||||
"PGTIOU-0-R0zlgrl4pdAQwBvJWO3vnNpevwqStbSGcq3vKB2SqSFFRnjPHt");
|
||||
|
|
|
@ -59,7 +59,7 @@ public class EhCacheBasedTicketCacheTests extends TestCase {
|
|||
|
||||
private CasAuthenticationToken getToken() {
|
||||
List proxyList = new Vector();
|
||||
proxyList.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
User user = new User("marissa", "password", true, true, true, true,
|
||||
new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")});
|
||||
|
|
|
@ -53,12 +53,12 @@ public class NamedCasProxyDeciderTests extends TestCase {
|
|||
|
||||
// Build the ticket returned from CAS
|
||||
List proxyList = new Vector();
|
||||
proxyList.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
proxyList.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
|
||||
// Build the list of valid nearest proxies
|
||||
List validProxies = new Vector();
|
||||
validProxies.add("https://localhost/portal/j_acegi_cas_security_check");
|
||||
validProxies.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
validProxies.add("https://localhost/portal/j_spring_cas_security_check");
|
||||
validProxies.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
proxyDecider.setValidProxies(validProxies);
|
||||
proxyDecider.afterPropertiesSet();
|
||||
|
||||
|
@ -102,8 +102,8 @@ public class NamedCasProxyDeciderTests extends TestCase {
|
|||
|
||||
// Build the list of valid nearest proxies
|
||||
List validProxies = new Vector();
|
||||
validProxies.add("https://localhost/portal/j_acegi_cas_security_check");
|
||||
validProxies.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
validProxies.add("https://localhost/portal/j_spring_cas_security_check");
|
||||
validProxies.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
proxyDecider.setValidProxies(validProxies);
|
||||
|
||||
assertEquals(validProxies, proxyDecider.getValidProxies());
|
||||
|
@ -115,12 +115,12 @@ public class NamedCasProxyDeciderTests extends TestCase {
|
|||
|
||||
// Build the ticket returned from CAS
|
||||
List proxyList = new Vector();
|
||||
proxyList.add("https://localhost/untrustedWebApp/j_acegi_cas_security_check");
|
||||
proxyList.add("https://localhost/untrustedWebApp/j_spring_cas_security_check");
|
||||
|
||||
// Build the list of valid nearest proxies
|
||||
List validProxies = new Vector();
|
||||
validProxies.add("https://localhost/portal/j_acegi_cas_security_check");
|
||||
validProxies.add("https://localhost/newPortal/j_acegi_cas_security_check");
|
||||
validProxies.add("https://localhost/portal/j_spring_cas_security_check");
|
||||
validProxies.add("https://localhost/newPortal/j_spring_cas_security_check");
|
||||
proxyDecider.setValidProxies(validProxies);
|
||||
proxyDecider.afterPropertiesSet();
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public class RejectProxyTicketsTests extends TestCase {
|
|||
public void testRejectsIfAnyProxyInList() {
|
||||
RejectProxyTickets proxyDecider = new RejectProxyTickets();
|
||||
List proxyList = new Vector();
|
||||
proxyList.add("https://localhost/webApp/j_acegi_cas_security_check");
|
||||
proxyList.add("https://localhost/webApp/j_spring_cas_security_check");
|
||||
|
||||
try {
|
||||
proxyDecider.confirmProxyListTrusted(proxyList);
|
||||
|
|
|
@ -65,7 +65,7 @@ public class CasProxyTicketValidatorTests extends TestCase {
|
|||
public void testNormalOperation() {
|
||||
ServiceProperties sp = new ServiceProperties();
|
||||
sp.setSendRenew(true);
|
||||
sp.setService("https://my.com/webapp//j_acegi_cas_security_check");
|
||||
sp.setService("https://my.com/webapp//j_spring_cas_security_check");
|
||||
|
||||
CasProxyTicketValidator tv = new MockCasProxyTicketValidator(true, false);
|
||||
tv.setCasValidate("https://company.com/cas/proxyvalidate");
|
||||
|
|
|
@ -106,9 +106,9 @@ public class AbstractProcessingFilterTests extends TestCase {
|
|||
MockHttpServletRequest request = createMockRequest();
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
MockAbstractProcessingFilter filter = new MockAbstractProcessingFilter();
|
||||
filter.setFilterProcessesUrl("/j_acegi_security_check");
|
||||
filter.setFilterProcessesUrl("/j_spring_security_check");
|
||||
|
||||
request.setRequestURI("/mycontext/j_acegi_security_check;jsessionid=I8MIONOSTHOR");
|
||||
request.setRequestURI("/mycontext/j_spring_security_check;jsessionid=I8MIONOSTHOR");
|
||||
assertTrue(filter.requiresAuthentication(request, response));
|
||||
}
|
||||
|
||||
|
@ -281,7 +281,7 @@ public class AbstractProcessingFilterTests extends TestCase {
|
|||
AbstractProcessingFilter filter = new MockAbstractProcessingFilter();
|
||||
filter.setAuthenticationManager(new MockAuthenticationManager());
|
||||
filter.setDefaultTargetUrl("/");
|
||||
filter.setFilterProcessesUrl("/j_acegi_security_check");
|
||||
filter.setFilterProcessesUrl("/j_spring_security_check");
|
||||
|
||||
try {
|
||||
filter.afterPropertiesSet();
|
||||
|
@ -295,7 +295,7 @@ public class AbstractProcessingFilterTests extends TestCase {
|
|||
AbstractProcessingFilter filter = new MockAbstractProcessingFilter();
|
||||
filter.setAuthenticationFailureUrl("/failed.jsp");
|
||||
filter.setDefaultTargetUrl("/");
|
||||
filter.setFilterProcessesUrl("/j_acegi_security_check");
|
||||
filter.setFilterProcessesUrl("/j_spring_security_check");
|
||||
|
||||
try {
|
||||
filter.afterPropertiesSet();
|
||||
|
@ -309,7 +309,7 @@ public class AbstractProcessingFilterTests extends TestCase {
|
|||
AbstractProcessingFilter filter = new MockAbstractProcessingFilter();
|
||||
filter.setAuthenticationFailureUrl("/failed.jsp");
|
||||
filter.setAuthenticationManager(new MockAuthenticationManager());
|
||||
filter.setFilterProcessesUrl("/j_acegi_security_check");
|
||||
filter.setFilterProcessesUrl("/j_spring_security_check");
|
||||
|
||||
try {
|
||||
filter.afterPropertiesSet();
|
||||
|
|
|
@ -86,7 +86,7 @@ public class CasProcessingFilterEntryPointTests extends TestCase {
|
|||
public void testNormalOperationWithRenewFalse() throws Exception {
|
||||
ServiceProperties sp = new ServiceProperties();
|
||||
sp.setSendRenew(false);
|
||||
sp.setService("https://mycompany.com/bigWebApp/j_acegi_cas_security_check");
|
||||
sp.setService("https://mycompany.com/bigWebApp/j_spring_cas_security_check");
|
||||
|
||||
CasProcessingFilterEntryPoint ep = new CasProcessingFilterEntryPoint();
|
||||
ep.setLoginUrl("https://cas/login");
|
||||
|
@ -101,14 +101,14 @@ public class CasProcessingFilterEntryPointTests extends TestCase {
|
|||
ep.commence(request, response, null);
|
||||
|
||||
assertEquals("https://cas/login?service="
|
||||
+ URLEncoder.encode("https://mycompany.com/bigWebApp/j_acegi_cas_security_check", "UTF-8"),
|
||||
+ URLEncoder.encode("https://mycompany.com/bigWebApp/j_spring_cas_security_check", "UTF-8"),
|
||||
response.getRedirectedUrl());
|
||||
}
|
||||
|
||||
public void testNormalOperationWithRenewTrue() throws Exception {
|
||||
ServiceProperties sp = new ServiceProperties();
|
||||
sp.setSendRenew(true);
|
||||
sp.setService("https://mycompany.com/bigWebApp/j_acegi_cas_security_check");
|
||||
sp.setService("https://mycompany.com/bigWebApp/j_spring_cas_security_check");
|
||||
|
||||
CasProcessingFilterEntryPoint ep = new CasProcessingFilterEntryPoint();
|
||||
ep.setLoginUrl("https://cas/login");
|
||||
|
@ -122,7 +122,7 @@ public class CasProcessingFilterEntryPointTests extends TestCase {
|
|||
ep.afterPropertiesSet();
|
||||
ep.commence(request, response, null);
|
||||
assertEquals("https://cas/login?service="
|
||||
+ URLEncoder.encode("https://mycompany.com/bigWebApp/j_acegi_cas_security_check", "UTF-8") + "&renew=true",
|
||||
+ URLEncoder.encode("https://mycompany.com/bigWebApp/j_spring_cas_security_check", "UTF-8") + "&renew=true",
|
||||
response.getRedirectedUrl());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public class CasProcessingFilterTests extends TestCase {
|
|||
|
||||
public void testGetters() {
|
||||
CasProcessingFilter filter = new CasProcessingFilter();
|
||||
assertEquals("/j_acegi_cas_security_check", filter.getDefaultFilterProcessesUrl());
|
||||
assertEquals("/j_spring_cas_security_check", filter.getDefaultFilterProcessesUrl());
|
||||
}
|
||||
|
||||
public void testNormalOperation() throws Exception {
|
||||
|
|
|
@ -20,7 +20,7 @@ public class LogoutHandlerTests extends TestCase {
|
|||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
|
||||
request.setRequestURI("/j_acegi_logout;someparam=blah?otherparam=blah");
|
||||
request.setRequestURI("/j_spring_security_logout;someparam=blah?otherparam=blah");
|
||||
|
||||
assertTrue(filter.requiresLogout(request, response));
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class LogoutHandlerTests extends TestCase {
|
|||
request.setContextPath("/context");
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
|
||||
request.setRequestURI("/context/j_acegi_logout?param=blah");
|
||||
request.setRequestURI("/context/j_spring_security_logout?param=blah");
|
||||
|
||||
assertTrue(filter.requiresLogout(request, response));
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
request.setScheme("http");
|
||||
request.setServerName("localhost");
|
||||
request.setRequestURI("/j_acegi_switch_user");
|
||||
request.setRequestURI("/j_spring_security_switch_user");
|
||||
|
||||
return request;
|
||||
}
|
||||
|
@ -199,8 +199,8 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
|
||||
public void testBadConfigMissingAuthenticationDao() {
|
||||
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
|
||||
filter.setSwitchUserUrl("/j_acegi_switch_user");
|
||||
filter.setExitUserUrl("/j_acegi_exit_user");
|
||||
filter.setSwitchUserUrl("/j_spring_security_switch_user");
|
||||
filter.setExitUserUrl("/j_spring_security_exit_user");
|
||||
filter.setTargetUrl("/main.jsp");
|
||||
|
||||
try {
|
||||
|
@ -214,8 +214,8 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
public void testBadConfigMissingTargetUrl() {
|
||||
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
|
||||
filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
|
||||
filter.setSwitchUserUrl("/j_acegi_switch_user");
|
||||
filter.setExitUserUrl("/j_acegi_exit_user");
|
||||
filter.setSwitchUserUrl("/j_spring_security_switch_user");
|
||||
filter.setExitUserUrl("/j_spring_security_exit_user");
|
||||
|
||||
try {
|
||||
filter.afterPropertiesSet();
|
||||
|
@ -228,9 +228,9 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
public void testDefaultProcessesFilterUrlWithPathParameter() {
|
||||
MockHttpServletRequest request = createMockSwitchRequest();
|
||||
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
|
||||
filter.setSwitchUserUrl("/j_acegi_switch_user");
|
||||
filter.setSwitchUserUrl("/j_spring_security_switch_user");
|
||||
|
||||
request.setRequestURI("/webapp/j_acegi_switch_user;jsessionid=8JHDUD723J8");
|
||||
request.setRequestURI("/webapp/j_spring_security_switch_user;jsessionid=8JHDUD723J8");
|
||||
assertTrue(filter.requiresSwitchUser(request));
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
|
||||
// http request
|
||||
MockHttpServletRequest request = createMockSwitchRequest();
|
||||
request.setRequestURI("/j_acegi_exit_user");
|
||||
request.setRequestURI("/j_spring_security_exit_user");
|
||||
|
||||
// http response
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
|
@ -259,7 +259,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
// setup filter
|
||||
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
|
||||
filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
|
||||
filter.setExitUserUrl("/j_acegi_exit_user");
|
||||
filter.setExitUserUrl("/j_spring_security_exit_user");
|
||||
|
||||
MockFilterChain chain = new MockFilterChain(true);
|
||||
|
||||
|
@ -278,7 +278,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
|
||||
// http request
|
||||
MockHttpServletRequest request = createMockSwitchRequest();
|
||||
request.setRequestURI("/j_acegi_exit_user");
|
||||
request.setRequestURI("/j_spring_security_exit_user");
|
||||
|
||||
// http response
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
|
@ -286,7 +286,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
// setup filter
|
||||
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
|
||||
filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
|
||||
filter.setExitUserUrl("/j_acegi_exit_user");
|
||||
filter.setExitUserUrl("/j_spring_security_exit_user");
|
||||
|
||||
MockFilterChain chain = new MockFilterChain(true);
|
||||
|
||||
|
@ -305,13 +305,13 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
|
||||
MockHttpServletRequest request = createMockSwitchRequest();
|
||||
request.addParameter(SwitchUserProcessingFilter.SPRING_SECURITY_SWITCH_USERNAME_KEY, "jacklord");
|
||||
request.setRequestURI("/webapp/j_acegi_switch_user");
|
||||
request.setRequestURI("/webapp/j_spring_security_switch_user");
|
||||
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
MockFilterChain chain = new MockFilterChain(true);
|
||||
|
||||
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
|
||||
filter.setSwitchUserUrl("/j_acegi_switch_user");
|
||||
filter.setSwitchUserUrl("/j_spring_security_switch_user");
|
||||
filter.setTargetUrl("/webapp/someOtherUrl");
|
||||
filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
|
||||
|
||||
|
@ -323,11 +323,11 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
public void testRequiresExitUser() {
|
||||
// filter
|
||||
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
|
||||
filter.setExitUserUrl("/j_acegi_exit_user");
|
||||
filter.setExitUserUrl("/j_spring_security_exit_user");
|
||||
|
||||
// request
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
request.setRequestURI("/j_acegi_exit_user");
|
||||
request.setRequestURI("/j_spring_security_exit_user");
|
||||
|
||||
assertTrue(filter.requiresExitUser(request));
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
public void testRequiresSwitch() {
|
||||
// filter
|
||||
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
|
||||
filter.setSwitchUserUrl("/j_acegi_switch_user");
|
||||
filter.setSwitchUserUrl("/j_spring_security_switch_user");
|
||||
|
||||
// request
|
||||
MockHttpServletRequest request = createMockSwitchRequest();
|
||||
|
@ -350,7 +350,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
|
||||
// http request
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
request.setRequestURI("/webapp/j_acegi_switch_user");
|
||||
request.setRequestURI("/webapp/j_spring_security_switch_user");
|
||||
request.addParameter(SwitchUserProcessingFilter.SPRING_SECURITY_SWITCH_USERNAME_KEY, "jacklord");
|
||||
|
||||
// http response
|
||||
|
@ -359,7 +359,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
|
|||
// setup filter
|
||||
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
|
||||
filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
|
||||
filter.setSwitchUserUrl("/j_acegi_switch_user");
|
||||
filter.setSwitchUserUrl("/j_spring_security_switch_user");
|
||||
|
||||
MockFilterChain chain = new MockFilterChain(true);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class AuthenticationProcessingFilterTests extends TestCase {
|
|||
|
||||
public void testGetters() {
|
||||
AuthenticationProcessingFilter filter = new AuthenticationProcessingFilter();
|
||||
assertEquals("/j_acegi_security_check", filter.getDefaultFilterProcessesUrl());
|
||||
assertEquals("/j_spring_security_check", filter.getDefaultFilterProcessesUrl());
|
||||
}
|
||||
|
||||
public void testNormalOperation() throws Exception {
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<property name="authenticationManager"><ref bean="authenticationManager"/></property>
|
||||
<property name="authenticationFailureUrl"><value>/failed.jsp</value></property>
|
||||
<property name="defaultTargetUrl"><value>/</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_acegi_security_check</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_spring_security_check</value></property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
<bean id="casProxyDecider" class="org.springframework.security.providers.cas.proxy.RejectProxyTickets"/>
|
||||
|
||||
<bean id="serviceProperties" class="org.springframework.security.ui.cas.ServiceProperties">
|
||||
<property name="service" value="https://localhost:8443/contacts-cas/j_acegi_cas_security_check"/>
|
||||
<property name="service" value="https://localhost:8443/contacts-cas/j_spring_cas_security_check"/>
|
||||
<property name="sendRenew" value="false"/>
|
||||
</bean>
|
||||
|
||||
|
@ -106,7 +106,7 @@
|
|||
<value>
|
||||
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
|
||||
\A/secure/.*\Z=REQUIRES_SECURE_CHANNEL
|
||||
\A/j_acegi_cas_security_check.*\Z=REQUIRES_SECURE_CHANNEL
|
||||
\A/j_spring_cas_security_check.*\Z=REQUIRES_SECURE_CHANNEL
|
||||
\A.*\Z=REQUIRES_INSECURE_CHANNEL
|
||||
</value>
|
||||
</property>
|
||||
|
@ -134,7 +134,7 @@
|
|||
<property name="authenticationManager"><ref local="authenticationManager"/></property>
|
||||
<property name="authenticationFailureUrl"><value>/casfailed.jsp</value></property>
|
||||
<property name="defaultTargetUrl"><value>/</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_acegi_cas_security_check</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_spring_cas_security_check</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="casProcessingFilterEntryPoint" class="org.springframework.security.ui.cas.CasProcessingFilterEntryPoint">
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
<property name="authenticationManager"><ref bean="authenticationManager"/></property>
|
||||
<property name="authenticationFailureUrl"><value>/acegilogin.jsp?login_error=1</value></property>
|
||||
<property name="defaultTargetUrl"><value>/</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_acegi_security_check</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_spring_security_check</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="authenticationProcessingFilterEntryPoint" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint">
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
|
||||
\A/secure/.*\Z=REQUIRES_SECURE_CHANNEL
|
||||
\A/acegilogin.jsp.*\Z=REQUIRES_SECURE_CHANNEL
|
||||
\A/j_acegi_security_check.*\Z=REQUIRES_SECURE_CHANNEL
|
||||
\A/j_spring_security_check.*\Z=REQUIRES_SECURE_CHANNEL
|
||||
\A.*\Z=REQUIRES_INSECURE_CHANNEL
|
||||
]]></value>
|
||||
</property>
|
||||
|
@ -160,7 +160,7 @@
|
|||
<property name="authenticationManager"><ref bean="authenticationManager"/></property>
|
||||
<property name="authenticationFailureUrl"><value>/acegilogin.jsp?login_error=1</value></property>
|
||||
<property name="defaultTargetUrl"><value>/</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_acegi_security_check</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_spring_security_check</value></property>
|
||||
<property name="rememberMeServices"><ref local="rememberMeServices"/></property>
|
||||
</bean>
|
||||
|
||||
|
@ -192,7 +192,7 @@
|
|||
/hello.htm=ROLE_ANONYMOUS,ROLE_USER
|
||||
/logoff.jsp=ROLE_ANONYMOUS,ROLE_USER
|
||||
/switchuser.jsp=ROLE_SUPERVISOR
|
||||
/j_acegi_switch_user=ROLE_SUPERVISOR
|
||||
/j_spring_security_switch_user=ROLE_SUPERVISOR
|
||||
/acegilogin.jsp*=ROLE_ANONYMOUS,ROLE_USER
|
||||
/**=ROLE_USER
|
||||
]]></value>
|
||||
|
@ -204,8 +204,8 @@
|
|||
<!-- In this example 'marissa' has ROLE_SUPERVISOR that can switch to regular ROLE_USER(s) -->
|
||||
<bean id="switchUserProcessingFilter" class="org.springframework.security.ui.switchuser.SwitchUserProcessingFilter">
|
||||
<property name="userDetailsService" ref="jdbcDaoImpl" />
|
||||
<property name="switchUserUrl"><value>/j_acegi_switch_user</value></property>
|
||||
<property name="exitUserUrl"><value>/j_acegi_exit_user</value></property>
|
||||
<property name="switchUserUrl"><value>/j_spring_security_switch_user</value></property>
|
||||
<property name="exitUserUrl"><value>/j_spring_security_exit_user</value></property>
|
||||
<property name="targetUrl"><value>/spring-security-sample-contacts-filter/secure/index.htm</value></property>
|
||||
</bean>
|
||||
|
||||
|
|
|
@ -27,6 +27,6 @@
|
|||
</tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
<p><a href="<c:url value="add.htm"/>">Add</a> <p><a href="<c:url value="../j_acegi_logout"/>">Logoff</a> (also clears any remember-me cookie)
|
||||
<p><a href="<c:url value="add.htm"/>">Add</a> <p><a href="<c:url value="../j_spring_security_logout"/>">Logoff</a> (also clears any remember-me cookie)
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
</font>
|
||||
</c:if>
|
||||
|
||||
<form action="<c:url value='j_acegi_security_check'/>" method="POST">
|
||||
<form action="<c:url value='j_spring_security_check'/>" method="POST">
|
||||
<table>
|
||||
<tr><td>User:</td><td><input type='text' name='j_username' <c:if test="${not empty param.login_error}">value='<%= session.getAttribute(AuthenticationProcessingFilter.SPRING_SECURITY_LAST_USERNAME_KEY) %>'</c:if>></td></tr>
|
||||
<tr><td>Password:</td><td><input type='password' name='j_password'></td></tr>
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<%@ page import="org.springframework.security.context.SecurityContextHolder" %>
|
||||
<%@ page import="org.springframework.security.Authentication" %>
|
||||
<%@ page import="org.springframework.security.ui.AbstractProcessingFilter" %>
|
||||
<%@ page import="org.springframework.security.ui.webapp.AuthenticationProcessingFilter" %>
|
||||
<%@ page import="org.springframework.security.AuthenticationException" %>
|
||||
|
||||
<html>
|
||||
|
@ -21,7 +20,7 @@
|
|||
</font>
|
||||
</c:if>
|
||||
|
||||
<form action="<c:url value='j_acegi_exit_user'/>" method="POST">
|
||||
<form action="<c:url value='j_spring_security_exit_user'/>" method="POST">
|
||||
<table>
|
||||
<tr><td>Current User:</td><td>
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
</font>
|
||||
</c:if>
|
||||
|
||||
<form action="<c:url value='j_acegi_switch_user'/>" method="POST">
|
||||
<form action="<c:url value='j_spring_security_switch_user'/>" method="POST">
|
||||
<table>
|
||||
<tr><td>User:</td><td><input type='text' name='j_username'></td></tr>
|
||||
<tr><td colspan='2'><input name="switch" type="submit" value="Switch to User"></td></tr>
|
||||
|
|
|
@ -73,7 +73,7 @@ TROUBLESHOOTING
|
|||
load the Acegi Security webapp, get redirected to the CAS server, then
|
||||
after login they get redirected back to the Acegi Security webapp and
|
||||
receive a failure. This is because the CAS server redirects to something
|
||||
like https://server3.company.com/webapp/j_acegi_cas_security_check?ticket=ST-0-ER94xMJmn6pha35CQRoZ
|
||||
like https://server3.company.com/webapp/j_spring_cas_security_check?ticket=ST-0-ER94xMJmn6pha35CQRoZ
|
||||
which causes the "service ticket" (the "ticket" parameter) to be validated.
|
||||
net.sf.acegisecurity.providers.cas.ticketvalidator.CasProxyTicketValidator
|
||||
performs service ticket validation by delegation to CAS'
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<property name="authenticationManager" ref="authenticationManager"/>
|
||||
<property name="authenticationFailureUrl" value="/acegilogin.jsp?login_error=1"/>
|
||||
<property name="defaultTargetUrl" value="/"/>
|
||||
<property name="filterProcessesUrl" value="/j_acegi_security_check"/>
|
||||
<property name="filterProcessesUrl" value="/j_spring_security_check"/>
|
||||
<property name="rememberMeServices" ref="rememberMeServices"/>
|
||||
</bean>
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
</font>
|
||||
</c:if>
|
||||
|
||||
<form action="<c:url value='j_acegi_security_check'/>" method="POST">
|
||||
<form action="<c:url value='j_spring_security_check'/>" method="POST">
|
||||
<table>
|
||||
<tr><td>User:</td><td><input type='text' name='j_username' <c:if test="${not empty param.login_error}">value='<c:out value="${ACEGI_SECURITY_LAST_USERNAME}"/>'</c:if>></td></tr>
|
||||
<tr><td>Password:</td><td><input type='password' name='j_password'></td></tr>
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
This is a protected page. You can only see me if you are a supervisor.
|
||||
|
||||
<p><a href="../../">Home</a>
|
||||
<p><a href="../../j_acegi_logout">Logout</a>
|
||||
<p><a href="../../j_spring_security_logout">Logout</a>
|
||||
</body>
|
||||
</html>
|
|
@ -5,6 +5,6 @@ This is a protected page. You can get to me if you've been remembered,
|
|||
or if you've authenticated this session.
|
||||
|
||||
<p><a href="../">Home</a>
|
||||
<p><a href="../j_acegi_logout">Logout</a>
|
||||
<p><a href="../j_spring_security_logout">Logout</a>
|
||||
</body>
|
||||
</html>
|
|
@ -44,11 +44,11 @@ import java.io.IOException;
|
|||
* <br/> </servlet>
|
||||
* <br/> <servlet-mapping>
|
||||
* <br/> <servlet-name>openid</servlet-name>
|
||||
* <br/> <url-pattern>/j_acegi_openid_start</url-pattern>
|
||||
* <br/> <url-pattern>/j_spring_security_openid_start</url-pattern>
|
||||
* <br/> </servlet-mapping>
|
||||
* <br/>
|
||||
* <br/>Sample login form:
|
||||
* <br/><form method="POST" action="j_acegi_openid_start">
|
||||
* <br/><form method="POST" action="j_spring_security_openid_start">
|
||||
* <br/> <input type="text" name="j_username" />
|
||||
* <br/> <input type="password" name="j_password" />
|
||||
* <br/> <input type="submit" value="Verify" />
|
||||
|
@ -91,7 +91,7 @@ public class OpenIDLoginInitiationServlet extends HttpServlet {
|
|||
|
||||
/**
|
||||
* Servlet config key for looking up the form login URL from the Servlet config.
|
||||
* <br/><b>Only set the formLogin servlet init-param if you are not using</b> <code>/j_acegi_security_check</code>
|
||||
* <br/><b>Only set the formLogin servlet init-param if you are not using</b> <code>/j_spring_security_check</code>
|
||||
* <br/>
|
||||
* <br/> <init-param>
|
||||
* <br/> <description>The form login URL - for standard authentication</description>
|
||||
|
@ -107,7 +107,7 @@ public class OpenIDLoginInitiationServlet extends HttpServlet {
|
|||
public static final String CONSUMER_KEY = "openIDConsumer";
|
||||
private String errorPage = "index.jsp";
|
||||
private String identityField = "j_username";
|
||||
private String formLoginUrl = "/j_acegi_security_check";
|
||||
private String formLoginUrl = "/j_spring_security_check";
|
||||
|
||||
/**
|
||||
* Check for init-params
|
||||
|
@ -161,7 +161,7 @@ public class OpenIDLoginInitiationServlet extends HttpServlet {
|
|||
if ((password != null) && (password.length() > 0)) {
|
||||
logger.debug("Attempting to authenticate using username/password");
|
||||
|
||||
// forward to authenticationProcessingFilter (/j_acegi_security_check - depends on param names)
|
||||
// forward to authenticationProcessingFilter (/j_spring_security_check - depends on param names)
|
||||
req.getRequestDispatcher(formLoginUrl).forward(req, res);
|
||||
|
||||
} else {
|
||||
|
|
|
@ -69,7 +69,7 @@ public class OpenIDResponseProcessingFilter extends AbstractProcessingFilter {
|
|||
* @Override
|
||||
*/
|
||||
public String getDefaultFilterProcessesUrl() {
|
||||
return "/j_acegi_openid_security_check";
|
||||
return "/j_spring_openid_security_check";
|
||||
}
|
||||
|
||||
// dependency injection
|
||||
|
|
|
@ -109,7 +109,7 @@ public class OpenIdAuthenticationProcessingFilter extends AbstractProcessingFilt
|
|||
}
|
||||
|
||||
public String getDefaultFilterProcessesUrl() {
|
||||
return "/j_acegi_openid_security_check";
|
||||
return "/j_spring_openid_security_check";
|
||||
}
|
||||
|
||||
public String getErrorPage() {
|
||||
|
|
|
@ -55,7 +55,7 @@ public class JanRainOpenIDConsumer implements OpenIDConsumer, InitializingBean {
|
|||
//~ Instance fields ================================================================================================
|
||||
|
||||
private OpenIDStore store;
|
||||
private String returnToUrl = "j_acegi_openid_security_check";
|
||||
private String returnToUrl = "j_spring_openid_security_check";
|
||||
|
||||
//~ Methods ========================================================================================================
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ public class OpenIDResponseProcessingFilterTests extends TestCase {
|
|||
*/
|
||||
public void testGetDefaultFilterProcessesUrl() {
|
||||
OpenIDResponseProcessingFilter filter = new OpenIDResponseProcessingFilter();
|
||||
assertEquals("/j_acegi_openid_security_check", filter.getDefaultFilterProcessesUrl());
|
||||
assertEquals("/j_spring_openid_security_check", filter.getDefaultFilterProcessesUrl());
|
||||
}
|
||||
|
||||
//~ Inner Classes ==================================================================================================
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<!-- If LogoutFilter does not have setHandlers populated, introspect app ctx for LogoutHandlers, using Ordered (if present, otherwise assume Integer.MAX_VALUE) -->
|
||||
<!-- The logoutUrl and redirectAfterLogout are both optional and default to that shown -->
|
||||
<security:logout-support id="logoutFilter"
|
||||
redirectAfterLogoutUrl="/index.jsp" logoutUrl="/j_acegi_logout" />
|
||||
redirectAfterLogoutUrl="/index.jsp" logoutUrl="/j_spring_security_logout" />
|
||||
|
||||
<security:authentication-remember-me-services
|
||||
id="rememberMeServices" key="someValue" />
|
||||
|
@ -52,7 +52,7 @@
|
|||
|
||||
<!-- the URLs are all mandatory and have no defaults (well, except authenticationUrl) -->
|
||||
<security:authentication-form id="authenticationProcessingFilter"
|
||||
authenticationUrl="/j_acegi_security_check" defaultTargetUrl="/"
|
||||
authenticationUrl="/j_spring_security_check" defaultTargetUrl="/"
|
||||
errorFormUrl="/acegilogin.jsp?login_error=1" />
|
||||
|
||||
<!-- make it optional, if not supplied autodetect all auth-providers from app ctx, using Ordered to resolve their order -->
|
||||
|
|
|
@ -1250,7 +1250,7 @@ if (obj instanceof UserDetails) {
|
|||
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
|
||||
\A/secure/.*\Z=REQUIRES_SECURE_CHANNEL
|
||||
\A/acegilogin.jsp.*\Z=REQUIRES_SECURE_CHANNEL
|
||||
\A/j_acegi_security_check.*\Z=REQUIRES_SECURE_CHANNEL
|
||||
\A/j_spring_security_check.*\Z=REQUIRES_SECURE_CHANNEL
|
||||
\A.*\Z=REQUIRES_INSECURE_CHANNEL
|
||||
</value>
|
||||
</property>
|
||||
|
@ -2183,7 +2183,7 @@ if (obj instanceof UserDetails) {
|
|||
<property name="authenticationManager"><ref bean="authenticationManager"/></property>
|
||||
<property name="authenticationFailureUrl"><value>/login.jsp?login_error=1</value></property>
|
||||
<property name="defaultTargetUrl"><value>/security.do?method=getMainMenu</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_acegi_security_check</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_spring_security_check</value></property>
|
||||
<property name="siteminderUsernameHeaderKey"><value>SM_USER</value></property>
|
||||
<property name="formUsernameParameterKey"><value>j_username</value></property>
|
||||
</bean></programlisting></para>
|
||||
|
@ -2346,7 +2346,7 @@ public boolean supports(Class clazz);</programlisting></para>
|
|||
<para>The login form simply contains <literal>j_username</literal> and
|
||||
<literal>j_password</literal> input fields, and posts to a URL that is
|
||||
monitored by the filter (by default
|
||||
<literal>j_acegi_security_check</literal>). The filter is defined in
|
||||
<literal>j_spring_security_check</literal>). The filter is defined in
|
||||
<literal>web.xml</literal> behind a
|
||||
<literal>FilterToBeanProxy</literal> as follows:</para>
|
||||
|
||||
|
@ -2373,7 +2373,7 @@ public boolean supports(Class clazz);</programlisting></para>
|
|||
<property name="authenticationManager"><ref bean="authenticationManager"/></property>
|
||||
<property name="authenticationFailureUrl"><value>/acegilogin.jsp?login_error=1</value></property>
|
||||
<property name="defaultTargetUrl"><value>/</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_acegi_security_check</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_spring_security_check</value></property>
|
||||
</bean> </programlisting></para>
|
||||
|
||||
<para>The configured <literal>AuthenticationManager</literal>
|
||||
|
@ -3361,7 +3361,7 @@ key: A private key to prevent modification of the remember-me token
|
|||
indicate a <literal>service</literal> parameter, which is the
|
||||
callback URL for Acegi Security service. For example, the URL to
|
||||
which the browser is redirected might be
|
||||
<literal>https://my.company.com/cas/login?service=https%3A%2F%2Fserver3.company.com%2Fwebapp%2Fj_acegi_cas_security_check</literal>.</para>
|
||||
<literal>https://my.company.com/cas/login?service=https%3A%2F%2Fserver3.company.com%2Fwebapp%2Fj_spring_cas_security_check</literal>.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@ -3382,13 +3382,13 @@ key: A private key to prevent modification of the remember-me token
|
|||
<literal>ticket</literal> parameter, which is an opaque string
|
||||
representing the "service ticket". Continuing our earlier example,
|
||||
the URL the browser is redirected to might be
|
||||
<literal>https://server3.company.com/webapp/j_acegi_cas_security_check?ticket=ST-0-ER94xMJmn6pha35CQRoZ</literal>.</para>
|
||||
<literal>https://server3.company.com/webapp/j_spring_cas_security_check?ticket=ST-0-ER94xMJmn6pha35CQRoZ</literal>.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Back in the service web application, the
|
||||
<literal>CasProcessingFilter</literal> is always listening for
|
||||
requests to <literal>/j_acegi_cas_security_check</literal> (this
|
||||
requests to <literal>/j_spring_cas_security_check</literal> (this
|
||||
is configurable, but we'll use the defaults in this introduction).
|
||||
The processing filter will construct a
|
||||
<literal>UsernamePasswordAuthenticationToken</literal>
|
||||
|
@ -3421,7 +3421,7 @@ key: A private key to prevent modification of the remember-me token
|
|||
to the CAS server in order to validate the service ticket. The
|
||||
<literal>CasProxyTicketValidator</literal> may also include a
|
||||
proxy callback URL, which is included in this example:
|
||||
<literal>https://my.company.com/cas/proxyValidate?service=https%3A%2F%2Fserver3.company.com%2Fwebapp%2Fj_acegi_cas_security_check&ticket=ST-0-ER94xMJmn6pha35CQRoZ&pgtUrl=https://server3.company.com/webapp/casProxy/receptor</literal>.</para>
|
||||
<literal>https://my.company.com/cas/proxyValidate?service=https%3A%2F%2Fserver3.company.com%2Fwebapp%2Fj_spring_cas_security_check&ticket=ST-0-ER94xMJmn6pha35CQRoZ&pgtUrl=https://server3.company.com/webapp/casProxy/receptor</literal>.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@ -3736,7 +3736,7 @@ key: A private key to prevent modification of the remember-me token
|
|||
<para><programlisting>
|
||||
|
||||
<bean id="serviceProperties" class="org.springframework.security.ui.cas.ServiceProperties">
|
||||
<property name="service"><value>https://localhost:8443/contacts-cas/j_acegi_cas_security_check</value></property>
|
||||
<property name="service"><value>https://localhost:8443/contacts-cas/j_spring_cas_security_check</value></property>
|
||||
<property name="sendRenew"><value>false</value></property>
|
||||
</bean>
|
||||
|
||||
|
@ -3758,7 +3758,7 @@ key: A private key to prevent modification of the remember-me token
|
|||
<property name="authenticationManager"><ref bean="authenticationManager"/></property>
|
||||
<property name="authenticationFailureUrl"><value>/casfailed.jsp</value></property>
|
||||
<property name="defaultTargetUrl"><value>/</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_acegi_cas_security_check</value></property>
|
||||
<property name="filterProcessesUrl"><value>/j_spring_cas_security_check</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="exceptionTranslationFilter" class="org.springframework.security.ui.ExceptionTranslationFilter">
|
||||
|
|
|
@ -93,7 +93,7 @@ copy %acegi%\WEB-INF\lib\commons-codec-1.3.jar %spring%\samples\petclinic\war\WE
|
|||
<table style="width:100%">
|
||||
<tr>
|
||||
<td><a href="<c:url value="/welcome.htm"/>">Home</a></td>
|
||||
<td><a href="<c:url value="/j_acegi_logout"/>">Logout</a></td>
|
||||
<td><a href="<c:url value="/j_spring_security_logout"/>">Logout</a></td>
|
||||
<td style="text-align:right;color:silver">PetClinic :: a Spring Framework demonstration</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
Loading…
Reference in New Issue