Skip to content

Commit

Permalink
Do not allow for POST binding with SSO
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Dec 19, 2023
1 parent 5a49eb4 commit 477f966
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion myconext-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>org.openconext</groupId>
<artifactId>saml-idp</artifactId>
<version>0.0.7-SNAPSHOT</version>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ private void sso(HttpServletRequest request, HttpServletResponse response) throw
//prevent null-pointer and drop dead
return;
}
AuthnRequest authnRequest = this.samlService.parseAuthnRequest(samlRequest, true, isDeflated(request));
if (!HttpMethod.GET.name().equalsIgnoreCase(request.getMethod())) {
throw new IllegalArgumentException("Only GET redirect are support. Not: "+request.getMethod());
}
AuthnRequest authnRequest = this.samlService.parseAuthnRequest(samlRequest, true, true);

String requesterEntityId = requesterId(authnRequest);
String issuer = authnRequest.getIssuer().getValue();
Expand Down Expand Up @@ -330,10 +333,6 @@ private void addBrowserIdentificationCookie(HttpServletResponse response) {
response.setHeader("Set-Cookie", BROWSER_SESSION_COOKIE_NAME + "=true; SameSite=Lax" + (secureCookie ? "; Secure" : ""));
}

private boolean isDeflated(HttpServletRequest request) {
return HttpMethod.GET.name().equalsIgnoreCase(request.getMethod());
}

private String requesterId(AuthnRequest authenticationRequest) {
Issuer issuer = authenticationRequest.getIssuer();
String issuerValue = issuer != null ? issuer.getValue() : "";
Expand Down

0 comments on commit 477f966

Please sign in to comment.