Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring security @RegisteredOAuth2AuthorizedClient is not handled in the right way #2595

Open
jarekkar opened this issue May 20, 2024 · 0 comments

Comments

@jarekkar
Copy link

Describe the Bug

When @RegisteredOAuth2AuthorizedClient is added to the controller definition, it is rendered in Swagger-UI. For @AuthenticationPrincipal, everything works fine.

To Reproduce

Java: 21
Spring Boot: 3.2.5
Springdocs: 2.5.0

Code Example:

@Operation(summary = "Returns authenticated user details")
@GetMapping(value = "/users/me", produces = APPLICATION_JSON_VALUE)
UserView user(@AuthenticationPrincipal OidcUser principal, @RegisteredOAuth2AuthorizedClient OAuth2AuthorizedClient authorizedClient){
    return UserView.of(principal.getName(), principal.getEmail(), principal.getGivenName(), principal.getFamilyName());
}

In Swagger-UI, authorizedClient is rendered as a required query parameter.

Expected Behavior

authorizedClient should not be rendered in Swagger-UI.

Screenshots

image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant