Closed
Description
Summary
When using a Form Login, a single OAuth2 provider and the auto-generated login page, the auto-configured AuthenticationEntryPoint
will redirect to the provider immediately, bypassing the login page and effectively preventing form login.
Actual Behavior
When trying to access a protected resource, spring security will immediately redirect to the OAuth2 provider's authentication page instead of the local login page.
Expected Behavior
When Form Login is configured, the login page should never be skipped.
Configuration
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().authenticated()
.and()
.oauth2Login()
.and()
.oauth2Client()
.and()
.formLogin().permitAll();
}
spring.security.oauth2.client.registration.facebook.client-id=some-id
spring.security.oauth2.client.registration.facebook.client-secret=some-secret
Version
5.1.4-RELEASE, not sure as of which version this happens.
Sample
I don't have a sample, but I found the exact location of the bug:
The condition should check whether Form Login is enabled and don't apply the shortcut if it is.