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

Fix spring-security configuration for webmvc #662

Closed

Conversation

aafwu00
Copy link
Contributor

@aafwu00 aafwu00 commented Jul 25, 2021

Description

When spring security configuration with WebSecurityConfigurerAdapter, then throw IllegalStateException with message(Found WebSecurityConfigurerAdapter as well as SecurityFilterChain. Please select just one)
WebSecurityConfigurerAdapter loaded spring.factories file when default security configuration. Add ProblemHttpConfigur, Using this meachnism is solved that problem.
But, If not using WebSecurityConfigurerAdapter, spring.factories is not working. so added ProblemSecurityBeanPostProcessor will be configure exception handling

Motivation and Context

This fixes #501, #573 and also resolves #582

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@whiskeysierra
Copy link
Collaborator

👍

@whiskeysierra
Copy link
Collaborator

@aafwu00 Thank you for your contribution! 📣

Can you take a look?

Warning: Rule violated for class org.zalando.problem.spring.web.autoconfigure.security.ProblemSecurityBeanPostProcessor: lines covered ratio is 0.7, but expected minimum is 1.0
Warning: Rule violated for class org.zalando.problem.spring.web.autoconfigure.security.ProblemHttpConfigurer: lines covered ratio is 0.8, but expected minimum is 1.0

@aafwu00
Copy link
Contributor Author

aafwu00 commented Aug 29, 2021

@whiskeysierra Thank you for your feedback. I fixed test coverage.

@whiskeysierra
Copy link
Collaborator

👍

@whiskeysierra
Copy link
Collaborator

@aafwu00 Can you gpg-sign your commits?
See https://docs.github.com/articles/about-gpg/

@aafwu00
Copy link
Contributor Author

aafwu00 commented Aug 30, 2021

@whiskeysierra OK, I'll make another PR.

@aafwu00 aafwu00 closed this Aug 30, 2021
@aafwu00 aafwu00 deleted the feature/fix-configuration-spring-security branch August 30, 2021 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants