You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Linh <pd...@gmail.com> on 2011/11/07 08:18:47 UTC

Mount LoginPage for Form base authentication

Hi All,

I got a problem with mounting the LoginPage to be used in Form base
authentication.

My web.xml:
    <login-config>
        <auth-method>FORM</auth-method>
        <form-login-config>
            <form-login-page>/login</form-login-page>
            <form-error-page>/login</form-error-page>
        </form-login-config>
    </login-config>

My WicketApplication.init() method:
    mountBookmarkablePage("/login", LoginPage.class);

However, when I access a secure resource, I got this error (instead of my
login page): HTTP Status 404 - /myapp/login/

Thanks for your help.


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Mount-LoginPage-for-Form-base-authentication-tp3997703p3997703.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Mount LoginPage for Form base authentication

Posted by Linh <pd...@gmail.com>.
Igor, I got a work around. I removed the <login-form> configuration in my
web.xml, modify my LoginPage to call my AuthenticatedWebSession.signIn() as
usual, in my signIn(), I call to httpServletRequest.login(username,
password). This way, I can do manipulate the flow in Wicket (setting error
message, redirect back to LoginPage, etc).

I will create a small quickstart and try it out anyway.
Cheers.

- Linh

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Mount-LoginPage-for-Form-base-authentication-tp3997703p4014737.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Mount LoginPage for Form base authentication

Posted by Igor Vaynberg <ig...@gmail.com>.
very strange. try cerating a quickstart and attaching it to a jira.

-igor

On Mon, Nov 7, 2011 at 3:00 PM, Linh <pd...@gmail.com> wrote:
> Thanks Igor.
>
> With: mountBookmarkablePage("/login", LoginPage.class);  I can access my
> login page when I type in the browser: http://localhost:8080/myapp/login
> But I still encounter the error when accessing a secure resource: HTTP
> Status 404 - /myapp/login/
>
> If I changed my web.xml to have:
> <form-login-page>/myapp/login</form-login-page> , I got this error: HTTP
> Status 404 - /myapp/myapp/login/
>
> I'm using Wicket version 1.4.18.
>
> --
> Linh
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Mount-LoginPage-for-Form-base-authentication-tp3997703p4014180.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Mount LoginPage for Form base authentication

Posted by Linh <pd...@gmail.com>.
Thanks Igor.

With: mountBookmarkablePage("/login", LoginPage.class);  I can access my
login page when I type in the browser: http://localhost:8080/myapp/login
But I still encounter the error when accessing a secure resource: HTTP
Status 404 - /myapp/login/ 

If I changed my web.xml to have:
<form-login-page>/myapp/login</form-login-page> , I got this error: HTTP
Status 404 - /myapp/myapp/login/

I'm using Wicket version 1.4.18.

--
Linh

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Mount-LoginPage-for-Form-base-authentication-tp3997703p4014180.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Mount LoginPage for Form base authentication

Posted by Igor Vaynberg <ig...@gmail.com>.
maybe you need to change your urls to /myapp/login/ ?

-igor

On Sun, Nov 6, 2011 at 11:18 PM, Linh <pd...@gmail.com> wrote:
> Hi All,
>
> I got a problem with mounting the LoginPage to be used in Form base
> authentication.
>
> My web.xml:
>    <login-config>
>        <auth-method>FORM</auth-method>
>        <form-login-config>
>            <form-login-page>/login</form-login-page>
>            <form-error-page>/login</form-error-page>
>        </form-login-config>
>    </login-config>
>
> My WicketApplication.init() method:
>    mountBookmarkablePage("/login", LoginPage.class);
>
> However, when I access a secure resource, I got this error (instead of my
> login page): HTTP Status 404 - /myapp/login/
>
> Thanks for your help.
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Mount-LoginPage-for-Form-base-authentication-tp3997703p3997703.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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