Skip to content

WebFlux Cloud Foundry endpoint responses do not include the security error body #50255

Closed as not planned

Description

@htjworld

Spring Boot version: main

When a Cloud Foundry security check fails (expired token, access denied, etc.), the reactive SecureReactiveWebOperation returns only the HTTP status code with no response body:

// CloudFoundryWebFluxEndpointHandlerMapping.SecureReactiveWebOperation
if (!securityResponse.getStatus().equals(HttpStatus.OK)) {
    return Mono.just(new ResponseEntity<>(securityResponse.getStatus()));
}

The servlet counterpart includes a {"security_error":"..."} body:

// CloudFoundryWebEndpointServletHandlerMapping.SecureServletWebOperation
if (!securityResponse.getStatus().equals(HttpStatus.OK)) {
    return new ResponseEntity<Object>(securityResponse.getMessage(), securityResponse.getStatus());
}

The message takes the form {"security_error":"Access denied"} or {"security_error":"Token expired"} — information that SecurityInterceptor already computes but the reactive path silently discards.

Expected behavior: A failed Cloud Foundry security check in a WebFlux application returns the same {"security_error":"<reason>"} body as the servlet counterpart.

Actual behavior: Only the status code (401, 403, 503) is returned with an empty body.

I'd be happy to contribute a fix for this.

Activity

  1. added
    status: waiting-for-triage
    on Apr 30, 2026
  2. bclozel commented on Apr 30, 2026

    @bclozel
    Member

    Closing in favor of #50256

  3. added
    status: superseded
    and removed
    status: waiting-for-triage
    on Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: superseded

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions