Skip to content

Commit

Permalink
[SECURITY-2469]
Browse files Browse the repository at this point in the history
  • Loading branch information
kuisathaverat authored and daniel-beck committed Aug 25, 2021
1 parent 75473e6 commit 8a6db39
Show file tree
Hide file tree
Showing 4 changed files with 548 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ public class SamlCrumbExclusion extends CrumbExclusion {
@Override
public boolean process(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws IOException, ServletException {
String pathInfo = request.getPathInfo();
if (shouldExclude(pathInfo)) {
jenkins.model.Jenkins j = jenkins.model.Jenkins.get();
if (j.getSecurityRealm() instanceof SamlSecurityRealm
&& shouldExclude(request.getPathInfo())) {
chain.doFilter(request, response);
return true;
}
Expand All @@ -34,7 +35,7 @@ private static boolean shouldExclude(String pathInfo) {
LOG.fine("SamlCrumbExclusion.shouldExclude empty");
return false;
}
if (pathInfo.indexOf(SamlSecurityRealm.CONSUMER_SERVICE_URL_PATH, 1) > -1) {
if (pathInfo.startsWith("/" + SamlSecurityRealm.CONSUMER_SERVICE_URL_PATH)) {
LOG.fine("SamlCrumbExclusion.shouldExclude excluding '" + pathInfo + "'");
return true;
} else {
Expand Down
Loading

0 comments on commit 8a6db39

Please sign in to comment.