Skip to content

Actuator HTTP trace data not reported for OAuth endpoints #760

Closed
@mikesaurus

Description

@mikesaurus

Describe the bug
When implementing Spring Authorization Server and Spring Boot Actuator with the HTTP Trace endpoint enabled, Spring Boot Actuator does not report any trace data for requests to OAuth endpoints (/authorize, /token, etc.). Non-OAuth requests, such as the requests to the Actuator endpoints are reported as expected.

This was first discovered with our authorization server that implements a custom authorization consent page and integrates with Spring Boot Admin. Spring Boot Admin reports (via the authorization server Actuator endpoints) requests for Actuator endpoints and the custom authorization consent page (mapped in a custom controller). However, HTTP Trace data does not include the OAuth endpoint requests. This behavior was reproduced using the samples in the spring-authorization-server project.

To Reproduce

  1. Clone the spring-authorization-server
  2. Update the "default-authorizationserver" sample with these 3 changes:
  • Add the Spring Boot Actuator dependency to the modules .gradle file
    implementation "org.springframework.boot:spring-boot-starter-actuator"
  • Expose the Actuator endpoints in the application.yaml file
management:
  endpoints:
    web:
      exposure:
        include: '*'
  • Add an HttpTraceRepository bean to the server config
    @Bean
    public HttpTraceRepository httpTraceRepository() {
        return new InMemoryHttpTraceRepository();
    }
  1. Run the default-authorizationserver, messages-resource, and messages-client samples according to the README
  2. Go to http://127.0.0.1:8080 and run through the sample workflow
  3. Go to http://127.0.0.1:9000/actuator/httptrace and view the HTTP Trace data

Expected behavior
Requests/responses for all OAuth endpoints are reported via the /actuator/httptrace endpoint.

Sample

https://github.com/spring-projects/spring-authorization-server/tree/main/samples

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions