From 60baf14be41066581bacd8fd7fbe56a64e1e390a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Franti=C5=A1ek=20Bu=C4=8D=C3=ADk?= Date: Thu, 30 Sep 2021 13:23:22 +0200 Subject: [PATCH] Fix OPTIONS request on /token endpoint (#24) --- .../mitre/openid/connect/filter/MultiUrlRequestMatcher.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/filter/MultiUrlRequestMatcher.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/filter/MultiUrlRequestMatcher.java index c2c140b56..4f004dedf 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/filter/MultiUrlRequestMatcher.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/filter/MultiUrlRequestMatcher.java @@ -16,6 +16,8 @@ package org.mitre.openid.connect.filter; +import static org.springframework.web.bind.annotation.RequestMethod.OPTIONS; + import java.util.HashSet; import java.util.Set; @@ -45,6 +47,9 @@ public class MultiUrlRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest request) { + if (OPTIONS.toString().equalsIgnoreCase(request.getMethod())) { + return false; + } for (RequestMatcher matcher : matchers) { if (matcher.matches(request)) { return true;