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

How to return AuthenticationManagerBuilder without and() method #13549

Closed
awxiaoxian2020 opened this issue Jul 16, 2023 · 1 comment
Closed
Assignees
Labels
for: stackoverflow A question that's better suited to stackoverflow.com

Comments

@awxiaoxian2020
Copy link

@Bean
    public AuthenticationManager authenticationManager(HttpSecurity security) throws Exception {
        return security
                .getSharedObject(AuthenticationManagerBuilder.class)
                .userDetailsService(authorizeService)
                .and()
                .build();
    }

Is there a Lambda DSL alternative?

@awxiaoxian2020 awxiaoxian2020 added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Jul 16, 2023
@marcusdacoregio
Copy link
Contributor

Hi @awxiaoxian2020, we do not really recommend publishing an AuthenticationManager using the AuthenticationManagerBuilder as it can lead to some unexpected behaviors. Instead, prefer creating the AuthenticationManager by yourself, as mentioned here.

@marcusdacoregio marcusdacoregio added for: stackoverflow A question that's better suited to stackoverflow.com and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 19, 2023
@marcusdacoregio marcusdacoregio self-assigned this Jul 19, 2023
@marcusdacoregio marcusdacoregio removed the type: bug A general bug label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: stackoverflow A question that's better suited to stackoverflow.com
Projects
Archived in project
Development

No branches or pull requests

2 participants