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

.formLogin() support #1714

Closed
littl3rud3 opened this issue Jun 21, 2022 · 4 comments
Closed

.formLogin() support #1714

littl3rud3 opened this issue Jun 21, 2022 · 4 comments
Labels
invalid This doesn't seem right

Comments

@littl3rud3
Copy link

littl3rud3 commented Jun 21, 2022

As said in comment is there support for .formLogin()?

@SecurityScheme( name = "basicAuth", type = SecuritySchemeType.HTTP, scheme = "basic" ) public class Application

@SecurityRequirement(name = "basicAuth") public class Controller

` @bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {

    http.csrf().disable()
            .authorizeRequests()
            .antMatchers("/login").permitAll()
            .antMatchers("/v3/api-docs/**", "/swagger-ui/**", "/swagger-ui.html").permitAll()
            .anyRequest().authenticated()
            .and()
            .formLogin();

    return http.build();
}`

image

If change .formLogin() to httpBasic() that will work. But how to realize it with .formLogin()?

As said in swagger.io there are only 2 schemes(Bearer and Basic)

@yfath
Copy link

yfath commented Jul 11, 2022

Any update on this issue ? This is a really important feature as most project uses form login...

@lawrence-pressinnov
Copy link

Any update or workaround would be much appreciated !

@bnasslahsen
Copy link
Contributor

bnasslahsen commented Jul 30, 2022

@lawrence-pressinnov,

You should be using springdoc.show-login-endpoint=true together with springdoc-openapi-security.
If you find out you are still facing the same issue, Provide a Minimal, Reproducible Example - with HelloController that reproduces the problem.

@adrianbob
Copy link

adrianbob commented Nov 13, 2022

Hi @bnasslahsen,
I have raised this issue: #1931
And created this repo with sample code: https://github.com/adrianbob/springdoc-form-login
The form login is not working in the swagger-ui endpoint exposed by springdoc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

5 participants