You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Lucio Crusca <lu...@sulweb.org> on 2014/09/09 14:39:21 UTC

AuthenticatedWebSession.authenticate() not being called

Hi all,

in a webapp that worked until yesterday (and that has worked for the last
2 years), the AuthenticatedWebSession.authenticate() method is not being
called anymore. I have MySession class that extends
AuthenticatedWebSession. The MySession constructor gets called correctly.
I use a standard SignInPanel: when I click "Sign in" the page reloads but
the code execution doesn't reach the breakpoint at the first line of
authenticate() in MySession. The authenticate() method does have the
@Override annotation, so I'm sure it has the correct signature.

Changes I've made since yesterday are only to the css, some HTML, a few
new initParameters in web.xml, but nothing directly related to the login
process... any clue about what could be causing that behavior? What should
I check first?

Btw, no, I didn't commit the code yesterday before those changes, so now I
can't revert, my bad.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AuthenticatedWebSession.authenticate() not being called

Posted by Paul Bors <pa...@bors.ws>.
Irrespective of the UI, have your read through
http://wicket.apache.org/learn/projects/authroles.html ?

Most likely the wicket-auth-roles login page is using one of the documented
annotations that makes all the difference for you. Try to place that
annotation on your page (I haven't read your code...)

On Wed, Sep 17, 2014 at 5:20 AM, Lucio Crusca <lu...@sulweb.org> wrote:

> I've moved one step forward: the authenticate() method now gets called if
> I use the SignInPage class included in wicket-auth-roles instead of my own
> SignInPage.
>
> However, as you can see in the code I posted yesterday, my SignInPage is
> very simple and, compared to the one bundled with wicket, it only has a
> additional Label and some minor html differences.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: AuthenticatedWebSession.authenticate() not being called

Posted by Lucio Crusca <lu...@sulweb.org>.
I've moved one step forward: the authenticate() method now gets called if
I use the SignInPage class included in wicket-auth-roles instead of my own
SignInPage.

However, as you can see in the code I posted yesterday, my SignInPage is
very simple and, compared to the one bundled with wicket, it only has a
additional Label and some minor html differences.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AuthenticatedWebSession.authenticate() not being called

Posted by Lucio Crusca <lu...@sulweb.org>.
>> Puzzled. I try to create a quickstart, but the real problem is that I'm
>> pretty sure the quickstart will work perfectly. Even my code has worked
>> perfectly for the last 2 years...
>
> Here is a quickstart-like piece of code showing the problem (I obtained it
> by cutting away unneded pieces from my project):
>
> http://www.sulweb.org/download/sparsi/swquick.zip
>
> any user/password will do (i.e. the code would accept any of them, but
> they won't work anyway). I expect this code to login any user with any
> password and reach AuthenticatedPage. It reloads the SignInPage instead
> and the authenticate() method never gets called.
>

Now I've also tried with a real, minimal quickstart, and it works
(obviously). However I still can't spot the problem in my code.

Please help.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AuthenticatedWebSession.authenticate() not being called

Posted by Lucio Crusca <lu...@sulweb.org>.
> Puzzled. I try to create a quickstart, but the real problem is that I'm
> pretty sure the quickstart will work perfectly. Even my code has worked
> perfectly for the last 2 years...

Here is a quickstart-like piece of code showing the problem (I obtained it
by cutting away unneded pieces from my project):

http://www.sulweb.org/download/sparsi/swquick.zip

any user/password will do (i.e. the code would accept any of them, but
they won't work anyway). I expect this code to login any user with any
password and reach AuthenticatedPage. It reloads the SignInPage instead
and the authenticate() method never gets called.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AuthenticatedWebSession.authenticate() not being called

Posted by Lucio Crusca <lu...@sulweb.org>.
While debugging the problem I first moved to Wicket 6.17 and then set a
breakpoint in SignInPanel.java (Wicket sources) at line 310, which is the
first line of the onSubmit() method of the SignInForm Wicket class.

That breakpoint does not get hit: Wicket, in response to the HTTP request
generated by the SignInForm submit button, creates a new SalixSignInPage
and does not call onSubmit() on the existing form.

Puzzled. I try to create a quickstart, but the real problem is that I'm
pretty sure the quickstart will work perfectly. Even my code has worked
perfectly for the last 2 years...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AuthenticatedWebSession.authenticate() not being called

Posted by Lucio Crusca <lu...@sulweb.org>.
> Hi all,
>
> in a webapp that worked until yesterday (and that has worked for the last
> 2 years), the AuthenticatedWebSession.authenticate() method is not being
> called anymore. I have MySession class that extends
> AuthenticatedWebSession. The MySession constructor gets called correctly.
> I use a standard SignInPanel: when I click "Sign in" the page reloads but
> the code execution doesn't reach the breakpoint at the first line of
> authenticate() in MySession. The authenticate() method does have the
> @Override annotation, so I'm sure it has the correct signature.
>
> Changes I've made since yesterday are only to the css, some HTML, a few
> new initParameters in web.xml, but nothing directly related to the login
> process... any clue about what could be causing that behavior? What should
> I check first?
>

I've made some progress in trying to understand what's going on, but I
still haven't found a solution.

When I click "Sign in", wicket creates a new instance of my
SalixSignInPage.java using the default constructor: it is a simple page
that contains only the SignInPanel. No error messages reported. I'm using
wicket 6.16.

Here is the call stack:

SalixSignInPage.<init>:30
NativeConstructorAccessorImpl.newInstance0
NativeConstructorAccessorImpl.newInstance:62
DelegatingConstructorAccessorImpl.newInstance:45
Constructor.newInstance:408
DefaultPageFactory.newPage:175
DefaultPageFactory.newPage:67
DefaultMapperContext.newPageInstance:133
PageProvider.resolvePageInstance:268
PageProvider.getPageInstance:166
ListenerInterfaceRequestHandler.getPage:96
ListenerInterfaceRequestHandler.respond:157
RequestCycle$HandlerExecutor.respond:862
RequestHandlerStack.execute:64
RequestCycle.execute:261
RequestCycle.processRequest:218
RequestCycle.processRequestAndDetach:289
WicketFilter.processRequestCycle:259
WicketFilter.processRequest:201
WicketFilter.doFilter:282
[...]

Does this shed some light?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org