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

Apply Spring Security configuration to WebTestClient #13632

Closed
shortstories opened this issue Jul 2, 2018 · 2 comments
Closed

Apply Spring Security configuration to WebTestClient #13632

shortstories opened this issue Jul 2, 2018 · 2 comments
Assignees
Labels
theme: testing Issues related to testing type: enhancement A general enhancement
Milestone

Comments

@shortstories
Copy link

Hi.
In testing codes that applied spring-security, I felt the need for a secure flag.
Checking WebTestClientAutoConfiguration, I could see that customizing is possible by WebTestClientBuilderCustomizer. However, since WebTestClient.Builder.configureClient() has already been called, So I couldn't apply MockServerConfigurer that provided by spring-security.
If possible, it would be best to enable or disable the security option via the secure flag like @AutoConfigureMockMvc. If that's not possible, at least add logic to apply MockServerConfigurer beans.

@shortstories shortstories changed the title Add secure flag to @WebFluxTest and @AutoConfigureWebTestClient Add secure flag to @WebFluxTest and @AutoConfigureWebTestClient Jul 2, 2018
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 2, 2018
@mbhave mbhave added type: enhancement A general enhancement theme: testing Issues related to testing and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 2, 2018
@mbhave mbhave added this to the Backlog milestone Jul 2, 2018
@mbhave mbhave self-assigned this Aug 31, 2018
@mbhave mbhave modified the milestones: 2.1.x, 2.1.0.M3 Sep 11, 2018
@mbhave mbhave closed this as completed in ab6bdc7 Sep 11, 2018
@philwebb philwebb changed the title Add secure flag to @WebFluxTest and @AutoConfigureWebTestClient Apply springSecurity configurer to WebTestClient Sep 12, 2018
@philwebb philwebb changed the title Apply springSecurity configurer to WebTestClient Apply Spring Securiry configuration to WebTestClient Sep 12, 2018
@hantsy
Copy link

hantsy commented Nov 9, 2018

Like @WebMvcTest, why not add a secure to @WebFluxTest? I encountered similar problem when upgraded to Spring Boot 2.1.0.RELEASE, https://stackoverflow.com/questions/53207961/why-webfluxtest-enable-spring-security-in-spring-boot-2-1-0-release

@wilkinsona wilkinsona changed the title Apply Spring Securiry configuration to WebTestClient Apply Spring Security configuration to WebTestClient Nov 9, 2018
@wilkinsona
Copy link
Member

@hantsy I have replied on Stack Overflow which is the right place to ask questions like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: testing Issues related to testing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants