Description
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
- Clone the spring-authorization-server
- 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();
}
- Run the
default-authorizationserver
,messages-resource
, andmessages-client
samples according to the README - Go to
http://127.0.0.1:8080
and run through the sample workflow - 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