Skip to content

Commit

Permalink
Remove unneeded handling of FORM auth in RealmBase.
Browse files Browse the repository at this point in the history
The login and error pages are handled via forward, so processing completes before this code is ever reached.
The action page is handled elsewhere.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1377887 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Konstantin Kolinko committed Aug 27, 2012
1 parent 8dc0459 commit a68cace
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions java/org/apache/catalina/realm/RealmBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.apache.catalina.Wrapper;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.deploy.LoginConfig;
import org.apache.catalina.deploy.SecurityCollection;
import org.apache.catalina.deploy.SecurityConstraint;
import org.apache.catalina.util.LifecycleMBeanBase;
Expand Down Expand Up @@ -792,31 +791,6 @@ public boolean hasResourcePermission(Request request,
if (constraints == null || constraints.length == 0)
return (true);

// Specifically allow access to the form login and form error pages
// and the "j_security_check" action
LoginConfig config = context.getLoginConfig();
if ((config != null) &&
(Constants.FORM_METHOD.equals(config.getAuthMethod()))) {
String requestURI = request.getRequestPathMB().toString();
String loginPage = config.getLoginPage();
if (loginPage.equals(requestURI)) {
if (log.isDebugEnabled())
log.debug(" Allow access to login page " + loginPage);
return (true);
}
String errorPage = config.getErrorPage();
if (errorPage.equals(requestURI)) {
if (log.isDebugEnabled())
log.debug(" Allow access to error page " + errorPage);
return (true);
}
if (requestURI.endsWith(Constants.FORM_ACTION)) {
if (log.isDebugEnabled())
log.debug(" Allow access to username/password submission");
return (true);
}
}

// Which user principal have we already authenticated?
Principal principal = request.getPrincipal();
boolean status = false;
Expand Down

0 comments on commit a68cace

Please sign in to comment.