Skip to content

Commit

Permalink
Bugfix: Allow trailing slash in token endpoint path (#1208)
Browse files Browse the repository at this point in the history
- Changes port routing filter to allow trailing slash in case of the token endpoint path

{patch}

Signed-off-by: Esta Nagy <nagyesta@gmail.com>
  • Loading branch information
nagyesta authored Oct 25, 2024
1 parent 05585d0 commit a0b6d12
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
@Slf4j
public class PortSeparationFilter extends OncePerRequestFilter {

@SuppressWarnings("NullableProblems")
@Override
protected void doFilterInternal(
final HttpServletRequest request, final HttpServletResponse response, final FilterChain filterChain)
final HttpServletRequest request,
final HttpServletResponse response,
final FilterChain filterChain)
throws ServletException, IOException {
final var secure = request.isSecure();
final boolean isTokenRequest = "/metadata/identity/oauth2/token".equals(request.getRequestURI());
final boolean isTokenRequest = request.getRequestURI().startsWith("/metadata/identity/oauth2/token");
final boolean unsecureTokenRequest = isTokenRequest && !secure;
final boolean secureVaultRequest = !isTokenRequest && secure;
if (unsecureTokenRequest || secureVaultRequest) {
Expand Down

0 comments on commit a0b6d12

Please sign in to comment.