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

Feature/fix configuration spring security #674

Merged

Conversation

aafwu00
Copy link
Contributor

@aafwu00 aafwu00 commented Aug 30, 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.

@aafwu00
Copy link
Contributor Author

aafwu00 commented Aug 30, 2021

@whiskeysierra This PR instead of #662

@whiskeysierra
Copy link
Collaborator

👍

@PascalSchumacher
Copy link
Contributor

Thank you very much! 👍

@whiskeysierra It would be great to have a release containing this.

@aafwu00 aafwu00 deleted the feature/fix-configuration-spring-security branch September 14, 2021 08:09
@whiskeysierra
Copy link
Collaborator

I released 0.27.0 just now 📣

@PascalSchumacher
Copy link
Contributor

@whiskeysierra Thank you very much!

@AhHa45
Copy link

AhHa45 commented Sep 15, 2022

I use 0.27.0 and still have this issue and I do not use a WebSecurityConfigurerAdapter

@jinyuttt
Copy link

jinyuttt commented Sep 17, 2022

I also have this problem.
pom.xml

 <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.3</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
  <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-security</artifactId>

            </dependency>
            <dependency>
                <groupId>org.springframework.security.oauth.boot</groupId>
                `<artifactId>spring-security-oauth2-autoconfigure</artifactId>`
            </dependency>

code:
@configuration
@EnableWebSecurity //
@EnableGlobalMethodSecurity(prePostEnabled = true) //
public class WebSecurityConfig {

@AhHa45
Copy link

AhHa45 commented Sep 21, 2022

@jinyuttt check your dependencies

I fixed my problem, I had a dependency included that was using WebSecurityConfigurerAdapter.
So I was not able to locate it in MY code but after upgrading the dependency it was resolved for me.

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