incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tsuyoshi Ito <tsuy....@trialox.org>
Subject Re: How to implement a CUG app with customized login page
Date Thu, 18 Nov 2010 12:11:50 GMT
Hi

found an easy way to customize the login page:

I have created a new template and registered is it with the following
rendering spec:

type: http://clerezza.org/2009/07/login#LoginPage
mode: mycustomlogin
media type = application/xhtml+xml

excerpt of my xhtml template:

<form action="/login?mode=mycustomlogin" method="post">
	<input name="user" size="30" type="text" value=""/></li>
	<input name="pass" size="30" type="password" value=""/></li>
	<input id="submitButton" type="submit" value="Log In"/>
	<input id="referer" name="referer" type="hidden" value="/admin/foo/"/>
</form>

Now when the form is submitted the jaxrs method login checks if the
credentials are ok. if this is the case then the user will be
redirected to /admin/foo otherwise the login page template with mode
"mycustomlogin" ( => my login template) will be rendered with the
additional properties:

http://clerezza.org/2009/07/login#message points to the error message
http://clerezza.org/2009/07/login#refererUri point to the referer uri


Cheers
tsuy


On Wed, Nov 17, 2010 at 11:09 AM, Tsuyoshi Ito <tsuy.ito@trialox.org> wrote:
> Hi folks
>
> I have a question about how to implement an CUG app with customized
> login page in apache clerezza:
>
> I want to implement an app for a specific group of users (users who
> have a specific role). these users have special permissions and should
> also have a dedicated login page (own Look&Feel - they should not seen
> the apache clerezza login page).
>
> As far as I know it is possible to create a customized login page with
> 2 form fields (username and password) and submit/post it to the
> corresponding jaxrs resource of apache clerezza. But when the login
> attempt failed the user is redirected to the login page of apache
> clerezza - this behaviour is confusing for the users. Therefore I am
> searching for an elegant way to customize the redirect after a failed
> login attempt?
>
> ATM I would implement a jaxrs "login" method (see CookieLogin.java in
> org.apache.clerezza.platform.security.auth.cookie), which takes care
> of the login and redirect.
>
> Are there any other possibilities to customize the redirect?
>
> Cheers
> Tsuy
>



-- 
--trialox ag--------------------------------------

Tsuyoshi Ito
Binzmuehlestrasse 14
CH-8050 Z├╝rich
Tel. +41 44 635 75 77
URL: http://trialox.org

Mime
View raw message