-
1. Re: creating our own login page
youssef.mohammed Sep 20, 2008 10:25 AM (in response to javauser007)use this
<input id="j_username"= type="text" name="j_username"/> -
2. Re: creating our own login page
youssef.mohammed Sep 20, 2008 10:29 AM (in response to javauser007)sorry I mean this ... my html code was swallowed in the previous reply.
<form id="myLoginForm" name="loginform" action="j_security_check" method="post"> <input id="j_username" type="text" value="" class="left registertext" name="j_username"/> <input id="j_password" type="password" value="" class="left registertext" name="j_password"/> </form>
-
3. Re: creating our own login page
javauser007 Sep 21, 2008 7:10 AM (in response to javauser007)hi youssef, thanks for your reply... But it is not working... see my below code...
my requirement is, In my Portlet if (user=null) then login page has to be displayed in my portlet view() mode. for that my view page if(user=null) is,
But it is not working..
I'm getting the following error...
org.jboss.portal.portlet.container.PortletInitializationException
plz help me... -
-
5. Re: creating our own login page
javauser007 Sep 21, 2008 7:17 AM (in response to javauser007)<table align="center"> <form id="myLoginForm" name="loginform" action="j_security_check" method="post"> <input id="j_username" type="text" value="" class="left registertext" name="j_username"/> <input id="j_password" type="password" value="" class="left registertext" name="j_password"/> </form> </table>
-
6. Re: creating our own login page
ryanm13 Sep 22, 2008 8:45 AM (in response to javauser007)try following these instructions:
http://wiki.jboss.org/wiki/PortletLogin -
7. Re: creating our own login page
danielk Sep 23, 2008 4:42 AM (in response to javauser007)j_security_check is working for me, but with one exception. If a user input wrong credentials, he will be redirected to JBoss Portal login page. What can i do to an error message on my own site?
-
8. Re: creating our own login page
javauser007 Sep 26, 2008 1:54 PM (in response to javauser007)Hi Daniek...
Can U post the code... and is it possible to assign that login page a s a view page of user profile portlet..........? plz post the code so that we can undestand how u did. -
9. Re: creating our own login page
danielk Sep 26, 2008 4:05 PM (in response to javauser007)You have already post the code in your previous answer:
<form id="myLoginForm" name="loginform" action="j_security_check" method="post"> <input id="j_username" type="text" value="" class="left registertext" name="j_username"/> <input id="j_password" type="password" value="" class="left registertext" name="j_password"/> </form>
All what i have done is paste it into my own login.xhtml, which i used as VIEW Page for my GenericFacesPortlet. If i logged in with right credentials = all fine. But if i try a wrong login, portal login page will be used and show the error message. If you are not using Richfaces like me, try to include code from above into your own JSP.
But is it possible to ignore this portal login page and redirect failures also to my own portlet site (login.xhtml) ? Something like that:<h:outputForumat value="#{noidea.failure}" rendered="#{loginBean.failure}" /> <form id="myLoginForm" name="loginform" action="j_security_check" method="post"> <input id="j_username" type="text" value="" class="left registertext" name="j_username"/> <input id="j_password" type="password" value="" class="left registertext" name="j_password"/> </form>
-
10. Re: creating our own login page
javauser007 Sep 30, 2008 2:23 PM (in response to javauser007)hi DanielK,
thanks 4 ur patience.... I tried with ur code but still it is not working for me....
can u plz send me code as a zip file to my mail itsformine@yahoo.co.in.............
Regards,
Giri -
11. Re: creating our own login page
javauser007 Sep 30, 2008 2:23 PM (in response to javauser007)hi DanielK,
thanks 4 ur patience.... I tried with ur code but still it is not working for me....
can u plz send me code as a zip file to my mail itsformine@yahoo.co.in.............
Regards,
Giri -
12. Re: creating our own login page
danielk Oct 1, 2008 4:52 AM (in response to javauser007)In your login.jsp just put in that code:
<form action="j_security_check" method="post" enctype="UTF-8"> <input id="j_username" type="text" value="" name="j_username"/> <input id="j_password" type="password" value="" name="j_password"/> <input type="submit" value="Login" /> </form>
It is important to use "j_security_check in your action, because of container managed security. If you have not configured LoginModules in JBoss, please look first how to do that. Also important are right IDs for input fields. Take care that there are no typos.
If your credentials are right you will be authorized and logged in. To check whether or not logged in, you can check if renderRequest.getUserPrincipal() is not null. In Portlets i mean it was (PortletRequest) request instead of renderRequest - parameter from method you must implement in your portlet. Another possibility is to use roles and security constraints.
Which pages are called for wrong credentials or general errors, you can configure here:[JBOSS_HOME]/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF/web.xml
Just search for login.jsp or error.jsp.
Why you get an exception i can not tell you because of lack of informations. You did not say where this exception occours (Portlet, JSP another palace ?) or under which circumstances it occours.
I hope it helped a little bit,
DanielK -
13. Re: creating our own login page
javauser007 Oct 8, 2008 6:10 PM (in response to javauser007)hi DanielK,
ThankQ, thanks alot... its working good..... thankQ very much for explaining all these things,.. -
14. Re: creating our own login page j_security_check exception
javauser007 Oct 8, 2008 6:45 PM (in response to javauser007)Hi Daniel,
what i have done is i have added the above code as user portlet's main page(i.e overview.xhtml) some times it works good without any problem but some times it throwing the following error....HTTP Status 404 - /j_security_check type Status report message /j_security_check description The requested resource (/j_security_check) is not available. JBossWeb/2.0.1.GA can u tell me the reason?