论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Custom login portlet lipsa mishra 2011年11月21日 上午1:01
RE: Custom login portlet ugandhar @ 2011年11月21日 上午2:48
RE: Custom login portlet lipsa mishra 2011年11月21日 上午3:43
RE: Custom login portlet ugandhar @ 2011年11月21日 上午4:12
RE: Custom login portlet srikanth a 2011年11月21日 上午4:26
RE: Custom login portlet Paul Cheong 2012年2月21日 下午7:27
RE: Custom login portlet vijay k 2012年3月13日 下午8:54
RE: Custom login portlet tian ci 2012年3月19日 上午12:01
RE: Custom login portlet Srikanth Reddy Sanivarapu 2012年4月3日 上午5:55
RE: Custom login portlet vijay k 2012年4月18日 下午11:40
RE: Custom login portlet Jasar Muhiyudheen 2012年4月30日 上午6:30
RE: Custom login portlet vijay k 2012年5月1日 下午1:52
RE: Custom login portlet Jasar Muhiyudheen 2012年5月1日 下午8:59
RE: Custom login portlet Bart Simpson 2012年7月10日 上午12:17
RE: Custom login portlet Bart Simpson 2012年9月18日 上午4:43
RE: Custom login portlet Mazhar Alam 2012年9月18日 上午5:18
RE: Custom login portlet Jasar Muhiyudheen 2013年1月8日 上午3:05
RE: Custom login portlet Bart Simpson 2013年1月8日 上午6:55
RE: Custom login portlet Ken Driscoll 2012年7月2日 下午1:27
RE: Custom login portlet Phap Phan 2012年7月9日 下午7:25
RE: Custom login portlet Robert Seedorff 2012年8月31日 上午12:37
RE: Custom login portlet David Pereira 2012年9月20日 下午12:37
RE: Custom login portlet Ime Prezime 2013年3月8日 上午3:20
RE: Custom login portlet Neil Griffin 2013年3月8日 上午7:13
RE: Custom login portlet Ime Prezime 2013年3月11日 上午3:10
RE: Custom login portlet Vernon Singleton 2013年3月11日 上午9:01
RE: Custom login portlet Ime Prezime 2013年3月12日 上午7:00
RE: Custom login portlet Kumar M 2013年3月14日 下午11:35
RE: Custom login portlet Vernon Singleton 2013年3月15日 上午6:51
RE: Custom login portlet Kumar M 2013年3月15日 上午7:17
Re: [Liferay Forums][3. Development] RE: Custom login portlet Vernon Singleton 2013年3月18日 上午10:44
RE: Custom login portlet Nilesh Gundecha 2013年4月16日 上午2:21
RE: Custom login portlet Nilesh Gundecha 2013年4月16日 上午2:34
RE: Custom login portlet Christophe Cariou 2013年9月11日 上午1:45
RE: Custom login portlet Abdulbasit Shaikh 2014年5月21日 上午4:33
RE: Custom login portlet Tariqul Islam 2015年2月21日 上午7:58
lipsa mishra
Custom login portlet
2011年11月21日 上午1:01
答复

lipsa mishra

等级: New Member

帖子: 14

加入日期: 2011年7月15日

最近的帖子

Hi all,

I want to use my own custom login portlet. by cliking on signin link &
i am redirected to my custom login portlet by using below lines in portal-ext.properties

auth.login.url=/web/guest/login

auth.login.portlet.name=Atyaf-Login

my custom portlet is having one Email-id field and one password field.

Now the problem is that when i am logging with test@liferay.com its not logging in.

Will anyone plz help me how to login a user through my own custom portlet.
ugandhar @
RE: Custom login portlet
2011年11月21日 上午2:48
答复

ugandhar @

等级: Junior Member

帖子: 25

加入日期: 2011年11月21日

最近的帖子

Hi Lipsa

Once you forward to the custom login portlet then you need to call liferay API in your custom login portlet ProcessAction() method and redirect to the home page which you have created.

in Liferay4.x we are using below API to call the liferay loginService.

LoginAction.login(httpReq, httpRes, UserId, Password, false);

But in Liferay6.x i feel they have change the liferay API like below.

LoginUtil.login(HttpServletRequest request, HttpServletResponse response, String login, password, boolean rememberMe, String authType)-- which gives an option to send login value as emailId by specifying authType="emailAddress".


Once you authenticated with any of the above liferay API method you can redirect to your home page.

NOTE: depends on your Liferay version you need to find the Liferay Login API params.
lipsa mishra
RE: Custom login portlet
2011年11月21日 上午3:43
答复

lipsa mishra

等级: New Member

帖子: 14

加入日期: 2011年7月15日

最近的帖子

Hi Ugandhar ,

Thanks for your valuable feedback
We have created a portlet. In that portlet we are not able to access the LoginUtil which I suppose is in portal-impl.jar.
And I think we cannot access the classes of portal-impl.jar directly.
Is there any other way to make the user login in the portal.


Thanks

lipsa
ugandhar @
RE: Custom login portlet
2011年11月21日 上午4:12
答复

ugandhar @

等级: Junior Member

帖子: 25

加入日期: 2011年11月21日

最近的帖子

Hi lipsa

we are using Ext environment so portal-impl.jar will be present and we imported the class directly and used it.
i think if we are using plugin environment then you can copy portal-impl.jar to your lib.

in Liferay6 we can use Hooks, as of now i am not having more idea on this.
srikanth a
RE: Custom login portlet
2011年11月21日 上午4:26
答复

srikanth a

等级: Regular Member

帖子: 144

加入日期: 2011年2月20日

最近的帖子

Hi Lipsa,
Try using the UserLocalServiceUtil class to authenticate the user and then forward to the required jsp.


regards
Sri
Paul Cheong
RE: Custom login portlet
2012年2月21日 下午7:27
答复

Paul Cheong

等级: New Member

帖子: 10

加入日期: 2005年8月2日

最近的帖子

I have the same issue.

I have tried to use UserLocalServiceUtil class to do the authentication, the authentication is success but when I forward to home page, liferay seems cannot regconize the user is logged in. Any paramenter should be set to session to let liferay know that the user is logged in?
vijay k
RE: Custom login portlet
2012年3月13日 下午8:54
答复

vijay k

等级: New Member

帖子: 4

加入日期: 2012年3月5日

最近的帖子

I was writing my own custom portlet for login process and I thought that as long as I call LoginUtil.login (from portal-impl.jar.) it will log me in. Then I realized that you can't have custom portlets using portal-impl.jar.

I think you can do it the ext plugin way, which I haven't tried.

But the following worked for me.

You can still use the service/method calls in portal-impl.jar from your custom portlets using PortalClassInvoker (from portal-service.jar located in tomcat/lib/ext), as follows (Thanks to Gordon Augat for telling me about this)
1MethodKey key = new MethodKey("com.liferay.portlet.login.util.LoginUtil", "login", HttpServletRequest.class, HttpServletResponse.class, String.class, String.class, boolean.class, String.class);
2PortalClassInvoker.invoke(false, key, new Object[] { PortalUtil.getHttpServletRequest(portletRequest), PortalUtil.getHttpServletResponse(portletResponse), username, password false, null});

after this redirect to,
1
2ThemeDisplay().getPathMain()


I don't want to go into details but, there is some classloader hierarchy/visibility magic happening here.

But, I had to do couple of more things to make it work.

1. set this in external portal properties file. I think it depends on what you are using to create custom portlets. I was using Vaadin and if I had this to true, the login process was invalidating the session, which was making my vaadin application freak out on me.
1
2session.enable.phishing.protection=false



Even after that my login didn't work. The LoginUtil.login method was being called correctly but I am still getting the login screen.

2.in liferay-portlet.xml, set the following. It took me couple of days to figure this out.
1
2 <private-session-attributes>false</private-session-attributes>

**NOTE: Liferay expects the <tags> in liferay-portlet.xml in certain order, otherwise it is barfing on me.

The Login process was like this, LoginUtil.login does its work and the com.liferay.portal.servlet.MainServlet.loginUser was making the login stick for the session by looking for some attributes ("j_remoteuser", "j_username" and few others) set by LoginUtil.login. The problem I had with my process was , when I call the LoginUtil.login method, it is setting lots of stuff in session object (gets from the request object I was sending) The session it was setting all of those was a PORTLETSESSION instance and MainServlet is looking into PORTALSESSION. So, I had to make sure that there is no private portlet session for my custom login portlet and have it use the portal session.

And that worked for me.


Hope that helps
tian ci
RE: Custom login portlet
2012年3月19日 上午12:01
答复

tian ci

等级: New Member

帖子: 1

加入日期: 2012年3月18日

最近的帖子

Hi Vijay,

I followed your method of implementation but I've encountered an exception stating "Invalid Authentication Token" after i send redirect to themeDisplay.gethPathMain(). On further troubleshooting from liferay src, it was thrown by the check() method in class com.liferay.portal.security.auth.SessionAuthToken. Apparently, the program is looking for a parameter "p_auth" from the request but it was not present.

vijay k:
I was writing my own custom portlet for login process and I thought that as long as I call LoginUtil.login (from portal-impl.jar.) it will log me in. Then I realized that you can't have custom portlets using portal-impl.jar.

I think you can do it the ext plugin way, which I haven't tried.

But the following worked for me.

You can still use the service/method calls in portal-impl.jar from your custom portlets using PortalClassInvoker (from portal-service.jar located in tomcat/lib/ext), as follows (Thanks to Gordon Augat for telling me about this)
1MethodKey key = new MethodKey("com.liferay.portlet.login.util.LoginUtil", "login", HttpServletRequest.class, HttpServletResponse.class, String.class, String.class, boolean.class, String.class);
2PortalClassInvoker.invoke(false, key, new Object[] { PortalUtil.getHttpServletRequest(portletRequest), PortalUtil.getHttpServletResponse(portletResponse), username, password false, null});

after this redirect to,
1
2ThemeDisplay().getPathMain()


I don't want to go into details but, there is some classloader hierarchy/visibility magic happening here.

But, I had to do couple of more things to make it work.

1. set this in external portal properties file. I think it depends on what you are using to create custom portlets. I was using Vaadin and if I had this to true, the login process was invalidating the session, which was making my vaadin application freak out on me.
1
2session.enable.phishing.protection=false



Even after that my login didn't work. The LoginUtil.login method was being called correctly but I am still getting the login screen.

2.in liferay-portlet.xml, set the following. It took me couple of days to figure this out.
1
2 <private-session-attributes>false</private-session-attributes>

**NOTE: Liferay expects the <tags> in liferay-portlet.xml in certain order, otherwise it is barfing on me.

The Login process was like this, LoginUtil.login does its work and the com.liferay.portal.servlet.MainServlet.loginUser was making the login stick for the session by looking for some attributes ("j_remoteuser", "j_username" and few others) set by LoginUtil.login. The problem I had with my process was , when I call the LoginUtil.login method, it is setting lots of stuff in session object (gets from the request object I was sending) The session it was setting all of those was a PORTLETSESSION instance and MainServlet is looking into PORTALSESSION. So, I had to make sure that there is no private portlet session for my custom login portlet and have it use the portal session.

And that worked for me.


Hope that helps
Srikanth Reddy Sanivarapu
RE: Custom login portlet
2012年4月3日 上午5:55
答复

Srikanth Reddy Sanivarapu

等级: Regular Member

帖子: 193

加入日期: 2008年11月14日

最近的帖子

Hi All,

I am getting the below exception after I deploy the code which they have given above.

java.lang.NoSuchMethodException: com.liferay.portlet.login.util.LoginUtil.login(com.liferay.portal.servlet.NamespaceServletRequest, com.liferay.portal.servlet.filters.strip.Stri
pResponse
, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.String)

Here is my code :
PortletRequest portletRequest = (PortletRequest)actionRequest;
PortletResponse portletResponse = (PortletResponse)actionResponse;

HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(portletRequest);
HttpServletResponse httpResponse = PortalUtil.getHttpServletResponse(portletResponse);

System.out.println("httpRequest--->" + httpRequest);
System.out.println("httpResponse--->" + httpResponse);

PortalClassInvoker.invoke("com.liferay.portlet.login.util.LoginUtil", "login",
new Object[] { httpRequest, httpResponse, "test@liferay.com", "test", false, CompanyConstants.AUTH_TYPE_EA});


Can any one help me with the correct way of getting HttpServletRequest Object and HettpServletResponse Object from actionReqeust and actionResponse objects in my processAction method.

Any help is really appreciated. Thanks in advance.

Regards,
Srik
vijay k
RE: Custom login portlet
2012年4月18日 下午11:40
答复

vijay k

等级: New Member

帖子: 4

加入日期: 2012年3月5日

最近的帖子

It all depends on which liferay version you are using. I am using 6.1 GA1.

My approach involved looking into the Liferay's core login process

which involves
1. calling a struts action mapped to "com.liferay.portal.action.LoginAction", which inturn makes a call to
2. LoginUtil.login(request, response, login, password, rememberMe, authType);

So, my idea was to duplicate the process by calling (LoginUtil.login(request, response, login, password, rememberMe, authType)). Hence, the following code.
1
2MethodKey key = new MethodKey("com.liferay.portlet.login.util.LoginUtil", "login", HttpServletRequest.class, HttpServletResponse.class, String.class, String.class, boolean.class, String.class);
3PortalClassInvoker.invoke(false, key, new Object[] { PortalUtil.getHttpServletRequest(portletRequest), PortalUtil.getHttpServletResponse(portletResponse), username, password false, null});
.

So, based on the problem (java.lang.NoSuchMethodException) you are having, I am thinking that you have a different version of liferay and it probably is not doing the same thing for the core login process. If that is the case, look into the core login struts action (most likely the same class "LoginAction") and see what it is doing.
Jasar Muhiyudheen
RE: Custom login portlet
2012年4月30日 上午6:30
答复

Jasar Muhiyudheen

等级: New Member

帖子: 3

加入日期: 2012年4月30日

最近的帖子

Hi,

I got the same issue and I am following the same way you mentiooned.

---------------------------------------------------------------
I have an index.jsp page where I have the following code.

MethodKey key = new
MethodKey("com.liferay.portlet.login.util.LoginUtil", "login",
HttpServletRequest.class, HttpServletResponse.class,
String.class, String.class, boolean.class, String.class);

PortalClassInvoker.invoke(false, key, new Object[] { request,
response, "monet", "m", true, "screenName"});

response.sendRedirect("http://localhost:9090/group/guest/home");
-----------------------------------------------------------------

In /liferay_portal_6.1/portlet-ext.properties I set 'session.enable.phishing.protection=false'

Since index.jsp is a normal jsp page, I cannot set '<private-session-attributes>false</private-session-attributes>' in liferay-portal.xml.

But still when I try to redirect to 'http://localhost:9090/group/guest/home', It goes to the login screen. I was getting some authentication exception which I solved. Now I think the user is getting autheticated but it redirects to the login screen again.

Please help me on this.

Thanks,
Jasar
vijay k
RE: Custom login portlet
2012年5月1日 下午1:52
答复

vijay k

等级: New Member

帖子: 4

加入日期: 2012年3月5日

最近的帖子

I don't understand what you meant by "............index.jsp is a normal jsp page, I cannot set <private-session-attributes>false</private-session-attributes>...............".

The setting is at the portlet level. Whether it is a jsp or some java code in an action/web-layer class that is doing the custom login process, it is part of your custom portlet. And that portlet should not have a private session (it has to use the same session as the portal), which is exactly what the setting "<private-session-attributes>" does. If your portlet has a private session, Liferay's MainServlet won't find the information it requires to log the user in, because it looks in the PORTAL SESSION and the login process that you called from your code, sets the information in the PORTLET SESSION that it gets from the request object you are passing in. In my case I have a Custom Login portlet with one UI component(I am using Vaadin instead of JSP in your case) and all it does is, shows the login page, do the custom login process and redirect to some place.
Jasar Muhiyudheen
RE: Custom login portlet
2012年5月1日 下午8:59
答复

Jasar Muhiyudheen

等级: New Member

帖子: 3

加入日期: 2012年4月30日

最近的帖子

In my war file there is no portlet. My war file contains only index.jsp. From that index.jsp I am calling LoginUtil.login method and redirects to 'http://localhost:9090/group/guest/home'. So I am not sure where to set <private-session-attributes>false</private-session-attributes>, since my liferay-portal.xml doesn't contain a <portlet> tag.
Ken Driscoll
RE: Custom login portlet
2012年7月2日 下午1:27
答复

Ken Driscoll

等级: Junior Member

帖子: 57

加入日期: 2012年7月2日

最近的帖子

Hello, I have followed this but am still having issues. I am using Liferay 6.1 GA1 and I am receiving no errors when it runs. However, it simply isn't logging me in.

Here is what I have:
1
2MethodKey key = new MethodKey("com.liferay.portlet.login.util.LoginUtil", "login", HttpServletRequest.class, HttpServletResponse.class, String.class, String.class, boolean.class, String.class);
3PortalClassInvoker.invoke(false, key, new Object[] { PortalUtil.getHttpServletRequest(actionRequest), PortalUtil.getHttpServletResponse(actionResponse), "user@test.com", "password", false, CompanyConstants.AUTH_TYPE_EA});


Please let me know if anyone else has had the same issue, or for any other ideas on how to get this working!

Thank you in advance.

vijay k:
I was writing my own custom portlet for login process and I thought that as long as I call LoginUtil.login (from portal-impl.jar.) it will log me in. Then I realized that you can't have custom portlets using portal-impl.jar.

I think you can do it the ext plugin way, which I haven't tried.

But the following worked for me.

You can still use the service/method calls in portal-impl.jar from your custom portlets using PortalClassInvoker (from portal-service.jar located in tomcat/lib/ext), as follows (Thanks to Gordon Augat for telling me about this)
1MethodKey key = new MethodKey("com.liferay.portlet.login.util.LoginUtil", "login", HttpServletRequest.class, HttpServletResponse.class, String.class, String.class, boolean.class, String.class);
2PortalClassInvoker.invoke(false, key, new Object[] { PortalUtil.getHttpServletRequest(portletRequest), PortalUtil.getHttpServletResponse(portletResponse), username, password false, null});

after this redirect to,
1
2ThemeDisplay().getPathMain()


I don't want to go into details but, there is some classloader hierarchy/visibility magic happening here.

But, I had to do couple of more things to make it work.

1. set this in external portal properties file. I think it depends on what you are using to create custom portlets. I was using Vaadin and if I had this to true, the login process was invalidating the session, which was making my vaadin application freak out on me.
1
2session.enable.phishing.protection=false



Even after that my login didn't work. The LoginUtil.login method was being called correctly but I am still getting the login screen.

2.in liferay-portlet.xml, set the following. It took me couple of days to figure this out.
1
2 <private-session-attributes>false</private-session-attributes>

**NOTE: Liferay expects the <tags> in liferay-portlet.xml in certain order, otherwise it is barfing on me.

The Login process was like this, LoginUtil.login does its work and the com.liferay.portal.servlet.MainServlet.loginUser was making the login stick for the session by looking for some attributes ("j_remoteuser", "j_username" and few others) set by LoginUtil.login. The problem I had with my process was , when I call the LoginUtil.login method, it is setting lots of stuff in session object (gets from the request object I was sending) The session it was setting all of those was a PORTLETSESSION instance and MainServlet is looking into PORTALSESSION. So, I had to make sure that there is no private portlet session for my custom login portlet and have it use the portal session.

And that worked for me.


Hope that helps
Phap Phan
RE: Custom login portlet
2012年7月9日 下午7:25
答复

Phap Phan

等级: New Member

帖子: 5

加入日期: 2012年3月26日

最近的帖子

I'm having the exact problem.

I'm currently running on Liferay 6.1.0 CE GA1 and want to create a custom login portlet. I followed your instructions but after click the button to log in, Liferay just doesn't let the user go through.
Bart Simpson
RE: Custom login portlet
2012年7月10日 上午12:17
答复

Bart Simpson

等级: Liferay Master

帖子: 524

加入日期: 2011年8月29日

最近的帖子

For authentication token , checkout the properties under
##
## Authentication Token
##

#
# Set this to true to enable authentication token security checks. The
# checks can be disabled for specific actions via the property
# "auth.token.ignore.actions" or for specific portlets via the init
# parameter "check-auth-token" in portlet.xml.
#
in portal.properties and you can make changes accordingly in portal-ext or even better in portlet.xml of your custom portlet

am gonna try this implementation and see how it works. Looks interesting. Till now I have used the autologin hooks for such situations.
Robert Seedorff
RE: Custom login portlet
2012年8月31日 上午12:37
答复

Robert Seedorff

等级: New Member

帖子: 3

加入日期: 2010年12月16日

最近的帖子

thx for your post, helped me alot!
Bart Simpson
RE: Custom login portlet
2012年9月18日 上午4:43
答复

Bart Simpson

等级: Liferay Master

帖子: 524

加入日期: 2011年8月29日

最近的帖子

I finally got some time to try it out with Liferay 6.1 GA2
The only change except for other things discussed in this thread is that another property is to be added to portal-ext.properties
1session.enable.phishing.protection=false

without this I was getting NPE when implementation tries to add session messages.
Mazhar Alam
RE: Custom login portlet
2012年9月18日 上午5:18
答复

Mazhar Alam

等级: Regular Member

帖子: 201

加入日期: 2011年11月25日

最近的帖子

helpful post...
David Pereira
RE: Custom login portlet
2012年9月20日 下午12:37
答复

David Pereira

等级: New Member

帖子: 11

加入日期: 2012年5月23日

最近的帖子

Muchas gracias, esto me ha ayudado mucho. Thanks!
Jasar Muhiyudheen
RE: Custom login portlet
2013年1月8日 上午3:05
答复

Jasar Muhiyudheen

等级: New Member

帖子: 3

加入日期: 2012年4月30日

最近的帖子

Still I am facing the same issue. No exception but user not getting in.

I have the settings in portal-ext.properties (session.enable.phishing.protection=false)
and in liferay-portlet.xml (<private-session-attributes>false</private-session-attributes> )

Even after that my login didn't work. The LoginUtil.login method was being called correctly but I am still getting the login screen.

my login code is inside portlet class.

try {
PortalClassInvoker.invoke(false, key, new Object[] { PortalUtil.getHttpServletRequest(request),
PortalUtil.getHttpServletResponse(response), "monet", "m", true, "screenName"});
response.sendRedirect("http://localhost:9090/group/guest/home");

} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

I am using Liferay 6.1-ce-ga1


Please help me out

Thanks,
Jasar
Bart Simpson
RE: Custom login portlet
2013年1月8日 上午6:55
答复

Bart Simpson

等级: Liferay Master

帖子: 524

加入日期: 2011年8月29日

最近的帖子

It worked for me when I tried, but it was on Liferay EE. Can you check:-
1. Debug the method LoginUtil.login and check the flow
2. After the request completes, open http://localhost:9090/group/guest/home in another tab and check if you are logged in
Ime Prezime
RE: Custom login portlet
2013年3月8日 上午3:20
答复

Ime Prezime

等级: New Member

帖子: 4

加入日期: 2013年3月7日

最近的帖子

Doesn't work for me.

I'm using Liferay 6.1.1 CE GA2.
I have custom JSF-based portlet.

LoginUtil.login method is executed, but nothing happens after that.

Property session.enable.phishing.protection is false.
Tag <private-session-attributes> in liferay-portlet.xml is false.

Any hints?
Maybe I'm passing wrong HttpServletRequest and HttpServletResponse objects?

Relevant code:
 1ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
 2       
 3PortletRequest portletRequest =  (PortletRequest) externalContext.getRequest();
 4PortletResponse portletResponse =  (PortletResponse) externalContext.getResponse();
 5       
 6HttpServletRequest httpServletRequest = PortalUtil.getHttpServletRequest(portletRequest);
 7HttpServletResponse httpServletResponse = PortalUtil.getHttpServletResponse(portletResponse);
 8
 9String username = "test";
10String password = "test";
11boolean rememberMe =false;
12       
13MethodKey methodKey = new MethodKey(
14         "com.liferay.portlet.login.util.LoginUtil",
15         "login",
16         HttpServletRequest.class,
17         HttpServletResponse.class,
18         String.class,
19         String.class,
20         boolean.class,
21         String.class );
22       
23String authType = CompanyConstants.AUTH_TYPE_SN;
24       
25PortalClassInvoker.invoke(
26         false,
27         methodKey,
28         new Object[] {
29                 httpServletRequest,
30                 httpServletResponse,
31                 username,
32                 password,
33                 rememberMe,
34                 authType } );
Neil Griffin
RE: Custom login portlet
2013年3月8日 上午7:13
答复

Neil Griffin

LIFERAY STAFF

等级: Liferay Legend

帖子: 2336

加入日期: 2005年7月26日

最近的帖子

Does your customer JSF Login portlet work if private-session-attributes=true (the default) and with a new out-of-the-box installation of Liferay Portal where session.enable.phishing.protection=false (the default)?
Ime Prezime
RE: Custom login portlet
2013年3月11日 上午3:10
答复

Ime Prezime

等级: New Member

帖子: 4

加入日期: 2013年3月7日

最近的帖子

Thanks for advice.

I tried fresh Liferay + JBoss 6.1.1 bundle.
I used Liferay Maven archetype to create simple JSF portlet plugin with only one portlet.
Portlet has a simple xhtml and simple view-scoped JSF bean with action from my previous post.

The behaviour is always the same, no matter how I set:
<private-session-attributes> in liferay-portlet.xml, or
session.enable.phishing.protection in portal-setup-wizard.properties.
Yes, I also tried the default combination, as you suggested.

Behaviour:
- If I enter correct screenname and password, action passes without errors. But, portal doesn't behave the same as with Liferay's login portlet when login is successful. ThemeDisplay.isSignedIn() method always returns false.
- If I enter incorrect screenname or password, I get AuthException from LoginUtil.login() method, which is expected.

Is there any custom login demo WAR which I can try?
Vernon Singleton
RE: Custom login portlet
2013年3月11日 上午9:01
答复

Vernon Singleton

LIFERAY STAFF

等级: Expert

帖子: 278

加入日期: 2013年1月14日

最近的帖子

Ime Prezime:
Is there any custom login demo WAR which I can try?


We ran into a similar problem in our testing with an older version of mojarra (i think it was mojarra 2.1.3 ..)

You will find a fairly recent version of a login portlet war in this snapshot directory:
https://oss.sonatype.org/content/repositories/snapshots/com/liferay/faces/demos/jsf2-login-portlet/3.1.2-ga3-SNAPSHOT/

You will also need to follow Stan Silvert's instructions for upgrading jboss's global class path with a newer version of mojarra ...
for this war you might as well use mojarra version 2.1.20.
Here are Stan's instructions:
https://community.jboss.org/message/756572#756572

Hope that helps,
Vernon
Ime Prezime
RE: Custom login portlet
2013年3月12日 上午7:00
答复

Ime Prezime

等级: New Member

帖子: 4

加入日期: 2013年3月7日

最近的帖子

This JSF login portlet demo is great. I tried it, and it worked.

I used ideas from it's source code to modify my own login portlet, which worked too after I used the same way to get HttpServletRequest and HttpServletResponse objects.

Thank you!
Kumar M
RE: Custom login portlet
2013年3月14日 下午11:35
答复

Kumar M

等级: New Member

帖子: 16

加入日期: 2012年9月12日

最近的帖子

Hi All,

I am new to liferay portal, currently i am working on liferay 6.1 EE with JSF primefaces , the above discussion is regarding the custom login portlet , i would like know when we will for Custom login portlet , we have already login portlet is available in lifeay.

Thanks and Regards
Vijay
Vernon Singleton
RE: Custom login portlet
2013年3月15日 上午6:51
答复

Vernon Singleton

LIFERAY STAFF

等级: Expert

帖子: 278

加入日期: 2013年1月14日

最近的帖子

Kumar M:
I am new to liferay portal, currently i am working on liferay 6.1 EE with JSF primefaces , the above discussion is regarding the custom login portlet , i would like know when we will for Custom login portlet , we have already login portlet is available in lifeay.


Hi Vijay,

Are you using Liferay with Tomcat? Jboss? Or some other configuration?
You may not have a need for a custom login portlet, but if you do, let me know.

- Vernon
Kumar M
RE: Custom login portlet
2013年3月15日 上午7:17
答复

Kumar M

等级: New Member

帖子: 16

加入日期: 2012年9月12日

最近的帖子

Hi Vernon,

I am using Tomcat.
I am not customizing the login portlet i want to know when we will go for customizing the login portlet.(any extra features)

Thanks
Vijay
Vernon Singleton
Re: [Liferay Forums][3. Development] RE: Custom login portlet
2013年3月18日 上午10:44
答复

Vernon Singleton

LIFERAY STAFF

等级: Expert

帖子: 278

加入日期: 2013年1月14日

最近的帖子

Well, you will go for customizing when the need arises. Maybe you will
want to change the flow of the login process, maybe change the options for
a first time login, or whatever your company or organization needs.

- Vernon



On Fri, Mar 15, 2013 at 10:17 AM, Kumar M from liferay.com <
forums@liferay.com> wrote:

> Hi Vernon,
>
> I am using Tomcat.
> I am not customizing the login portlet i want to know when we will go for
> customizing the login portlet.(any extra features)
>
> Thanks
> Vijay
>
>
> To view the thread, follow the link below:
>
> http://www.liferay.com/community/forums/-/message_boards/view_message/22677817
> --
> Thanks, Liferay.com Forums <http://http://www.liferay.com>
Nilesh Gundecha
RE: Custom login portlet
2013年4月16日 上午2:21
答复

Nilesh Gundecha

等级: Regular Member

帖子: 196

加入日期: 2009年11月30日

最近的帖子

Hi Friends,

I have implemented the Custom Login portlet and did all the steps as mentioned by Vijay K. All works fine except one strange issue -

If I load the page having my custom portlet and don't do anything for sometime (say half an hour) and then try to login then it gives me Forbidden status. I am not able to make out whats the issue. Any inputs please?

Regards,
Nilesh
附件

附件: Forbidden.png (21.1k)
Nilesh Gundecha
RE: Custom login portlet
2013年4月16日 上午2:34
答复

Nilesh Gundecha

等级: Regular Member

帖子: 196

加入日期: 2009年11月30日

最近的帖子

Can this happen because Liferay Login portlet and my Custom Login portlet as co-existing on the same page? Will they generate different auth token and so the issue?
Christophe Cariou
RE: Custom login portlet
2013年9月11日 上午1:45
答复

Christophe Cariou

等级: Junior Member

帖子: 47

加入日期: 2007年10月1日

最近的帖子

Hi vijay,

I used your method and it's working fine. I'm in the same context as you (Liferay 6.1 GA2 + Vaadin), except I'm on Vaadin 7.

The login action is correctly done and I redirect the user after login on a private page. All is fine.

BUT :
- If I close my browser after being logged in, without login out, and reopen it on the custom login page, the Vaadin portlet doesn't display at all !
Any other Vaadin portlet on public pages don't display at all.
I haven't any exception... just blank portlet (bootstrap code is present in the page).

To retrieve the portlets I must call a c/portal/logout url.

So, have you tested this case (closing browser after login and reopening the custom login page) and did you encounter the same trouble ?
If so, how did you correct it? perhaps via somme Vaadin session invalidation ?

Your help wilp be great for me.

Christophe
Abdulbasit Shaikh
RE: Custom login portlet
2014年5月21日 上午4:33
答复

Abdulbasit Shaikh

等级: New Member

帖子: 18

加入日期: 2013年5月16日

最近的帖子

Hi vijay k,

Thank you very very much. I was trying since last 3 days. Finally it worked for me. Thank you so much. But the only problem now is I am not able to redirect it to my custom liferay page.

Thanks and Regards,
Abdulbasit F Shaikh.
Tariqul Islam
RE: Custom login portlet
2015年2月21日 上午7:58
答复

Tariqul Islam

等级: New Member

帖子: 15

加入日期: 2013年1月27日

最近的帖子

I also faced this problem and finaly solve this issue.

Here below my blog link this may help...

http://tariqliferay.blogspot.com/2015/02/custom-login-portet-in-liferay.html