-
Notifications
You must be signed in to change notification settings - Fork 62
Description
Hello,
I'm developing a wicket web application that needs authentication. I'm using spring security for that.
Using an InMemoryUserDetailsManager works all fine. Switching to OAuth2 authentication doesn't work. The following exception:
IllegalStateException: Couln't find sign in page - please annotate the sign in page with @com.giffing.wicket.spring.boot.context.scan.WicketSignInPage
means that wicket is looking for a login page therefore it is unable to read authentication information from spring security context, I suppose.
I wrote a simple spring boot application with security, but without wicket-spring-boot, and It works, so I suppose is something related to wicket-spring-boot. Does it need a specific configuration for OAuth2? What I'm doing wrong?
Best regards
My security environment is quite simple:
I'm using @EnableAutoConfiguration
on @SpringBootApplication
class.
My application.yml
is
security:
oauth2:
client:
registration:
google:
clientId: myclentId
clientSecret: myclientSecret
scope:
- email
- profile
my WebSecurityConfigurerAdapter
is
@EnableWebSecurity
public class HttpSecurityConfig {
@Configuration
public static class OAuth2WebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.anyRequest().authenticated()
.and()
.oauth2Login()
;
}
@Bean(name="authenticationManager")
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
}
}