Swarm is designed to be plain and simple. In short this is what you need to do: 1 implement Principal (i could see about a reasonable default implementation , but my guess is you want to store this in a database anyway and i am not sure i want a dependency on jpa) 2 create policy files 3 implement WaspApplication (by extending SwarmApplication)
Off the top of my hat, that is al you need to get the default running. Off course if you want something special you need something more, but where don't you need to do that. But if you feel we could improve on some areas, let me know. Maurice On Nov 6, 2007 10:35 PM, <[EMAIL PROTECTED]> wrote: > I wished to try the basic Wicket authentication because it looked plain > simple (and simplicity and fewer code is my mantra!) > I had seen the Swarm one, but it didn't look as straightforward. Maybe I will > give it a try if I can't go with the standard one. > > Regards, > Hugues > > Mr Mean wrote: > > > > You are using the wrong authorization framework! > > > > :) No seriously now. I don't know what is wrong with your code, > > although the authenticate method might give some useful debugging > > info. > > There is however a second authorization framework for wicket called > > Swarm. you might want to check it out. > > http://wicketstuff.org/confluence/display/STUFFWIKI/Wicket-Security > > > > Maurice > > > > P.S. warning: shameless self-promoting :) > > > > > > > On Nov 5, 2007 2:32 PM, Hugues Pichereau <[EMAIL PROTECTED]> wrote: > >> Hi, > >> > >> I would like to use Wicket authentication, as in the examples. > >> So I modified the Wicket QuickStart project to use authentication, like > >> this: > >> > >> public class WicketApplication extends AuthenticatedWebApplication { > >> > >> public WicketApplication() { > >> } > >> > >> public Class getHomePage() { > >> return HomePage.class; > >> } > >> > >> @Override > >> protected Class<? extends WebPage> getSignInPageClass() { > >> return LoginPage.class; > >> } > >> > >> @Override > >> protected Class<? extends AuthenticatedWebSession> > >> getWebSessionClass() { > >> return WicketSession.class; > >> } > >> } > >> > >> > >> public class WicketSession extends AuthenticatedWebSession { > >> > >> public WicketSession(AuthenticatedWebApplication application, Request > >> request) { > >> super(application, request); > >> } > >> > >> @Override > >> public boolean authenticate(String arg0, String arg1) { > >> return false; // should block everybody > >> } > >> > >> @Override > >> public Roles getRoles() { > >> return null; > >> } > >> } > >> > >> > >> HomePage.html has: > >> # Admin page > >> > >> public class HomePage extends WebPage { > >> > >> public HomePage(final PageParameters parameters) { > >> add(new PageLink("goto-admin", AdminPage.class)); > >> } > >> } > >> > >> > >> LoginPage.html has: > >> > >> > >> public final class LoginPage extends SignInPage { > >> } > >> > >> > >> And finally, the admin page to protect: > >> > >> @AuthorizeInstantiation("USER") > >> public class AdminPage extends WebPage { > >> } > >> > >> The problem is that a click from the HomePage always brings the > >> AdminPage, without any > >> LoginPage displayed. > >> > >> I used Wicket 1.3 beta4. > >> > >> After reading the Wicket example and 2 tutorials on authentication, I > >> really can't see what I'm missing. > >> Any idea ? > >> > >> Hugues > >> > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > Quoted from: > http://www.nabble.com/Problem-with-wicket-authentication-tf4751663.html#a13602300 > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
