Skip to content

Commit

Permalink
Log headers
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Dec 21, 2024
1 parent 018d253 commit 377e1bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ public void configure(WebSecurity web) throws Exception {
"/images/**",
"/img/**",
"/js/**",
"/health",
"/internal/**",
"/info",
"/health",
"/serviceProvider/api/**");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public enum ShibbolethHeader {
Shib_NlEduPersonOrgUnit("Shib-nlEduPersonOrgUnit"),
Shib_NlEduPersonStudyBranch("Shib-nlEduPersonStudyBranch"),
Shib_NlStudielinkNummer("Shib-nlStudielinkNummer"),
Shib_SURFEckid("Shib-surfEckid");
Shib_SURFEckid("Shib-surfEckid"),
Shib_SURFautorisaties("Shib-surf-autorisaties");

private final String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class ShibbolethPreAuthenticatedProcessingFilter extends AbstractPreAuthe
.put("urn:mace:surffederatie.nl:attribute-def:nlEduPersonStudyBranch", Shib_NlEduPersonStudyBranch)
.put("urn:mace:surffederatie.nl:attribute-def:nlStudielinkNummer", Shib_NlStudielinkNummer)
.put("urn:mace:surf.nl:attribute-def:eckid", Shib_SURFEckid)
.put("urn:mace:surf.nl:attribute-def:surf-autorisaties", Shib_SURFautorisaties)
.build();
}

Expand Down Expand Up @@ -130,9 +131,9 @@ public ShibbolethPreAuthenticatedProcessingFilter(AuthenticationManager authenti
@Override
protected Object getPreAuthenticatedPrincipal(final HttpServletRequest request) {
Enumeration<String> headerNames = request.getHeaderNames();
if (headerNames != null && LOG.isTraceEnabled()) {
if (headerNames != null && !request.getRequestURI().endsWith("health") && !request.getRequestURI().endsWith("ico")) {
ArrayList<String> list = Collections.list(headerNames);
LOG.trace("Received headers {}", list.stream().collect(toMap(
LOG.info("Received headers {}", list.stream().collect(toMap(
name -> name,
name -> {
Enumeration<String> headers = request.getHeaders(name);
Expand Down

0 comments on commit 377e1bb

Please sign in to comment.