MarcGiffing / wicket-spring-boot

Spring Boot starter for Apache Wicket
151 stars 61 forks source link

@WicketSignInPage not working #108

Closed ChambreNoire closed 6 years ago

ChambreNoire commented 7 years ago

Hi, I have two pages, one annotated @WicketHomePage and the other @WicketSignInPage. However despite not being logged in, Wicket systematically renders the HomePage. Any ideas? Here's my config. Maybe I'm missing something in my yaml?

@Component
public class WicketConfig extends WicketBootSecuredWebApplication {

    @Override
    protected Class<? extends AbstractAuthenticatedWebSession> getWebSessionClass() {
        return WicketSession.class;
    }
    ...
}

and

public class WicketSession extends AuthenticatedWebSession {

    public WicketSession(final Request request) {
        super(request);
    }

    @Override
    protected boolean authenticate(String s, String s1) {
        return false;
    }
}

Thanks

martin-g commented 7 years ago

A page should be annotated with @AuthorizeInstantiation to be protected. In this case Wicket will redirect to the sign in page.

MarcGiffing commented 7 years ago

I've never tested the security configuration without spring security or shiro. https://github.com/MarcGiffing/wicket-spring-boot-examples/tree/master/spring-security . If the solution martin provided is not working than its a configuration problem of this project...