I'm using Spring Cloud Gateway with OpenAPI V3, and I've noticed an issue on the OpenAPI UI page when invoking the client credentials flow: the request to get an access token only includes the grant_type field, while client_id and client_secret are not sent.
Here's a screenshot of the issue:

Below is my OpenAPI configuration:
@Configuration
@OpenAPIDefinition(
info = @Info(
title = "API Gateway",
version = "1.0",
description = "API Gateway Documentation"
)
)
@SecurityScheme(
name = "oauth2",
type = SecuritySchemeType.OAUTH2,
flows = @OAuthFlows(
clientCredentials = @OAuthFlow(
tokenUrl = "http://localhost:8080/realms/test2/protocol/openid-connect/token",
scopes = {
@OAuthScope(name = "read", description = "read scope"),
@OAuthScope(name = "write", description = "write scope")
}
)
)
)
public class OpenApiConfig {
}
And my Maven configuration is as follows:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.3</version>
<relativePath />
</parent>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webflux-ui</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webflux-api</artifactId>
<version>2.5.0</version>
</dependency>
I'm looking for insights on whether this behavior is expected (due to OAuth2 specifications, which typically require the client credentials to be sent as part of the HTTP Basic authentication header) and what workarounds might be available to include client_id and client_secret in the token request.