Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Oussama Denden
Liefray MVC Portlet Signing in before submitting a form
January 30, 2013 2:02 PM
Answer

Oussama Denden

Rank: New Member

Posts: 9

Join Date: December 10, 2012

Recent Posts

Hi there,
Here is my workflow,
1) A guest has a form to fill and submit
2) When submitting the form the guest will be redirected to the sign in portlet he will have to sign in or create an account
3)After signing in/creating a new account the form will be submitted

can you help me please i am doing something like this

 1
 2                       LiferayPortletURL signinURL = PortletURLFactoryUtil.create(request,
 3                    PortletKeys.LOGIN, themeDisplay.getPlid(), "RENDER_PHASE");
 4            signinURL.setWindowState(WindowState.MAXIMIZED);
 5            signinURL.setPortletMode(PortletMode.VIEW);
 6            signinURL.setParameter("struts_action", "/login/login");
 7            String currentUrl = themeDisplay.getURLCurrent();
 8            signinURL.setParameter("redirect", currentUrl);
 9            response.sendRedirect(signinURL.toString());


but i always get:
Forbidden
You do not have permission to access the requested resource.
Gnaniyar Zubair
RE: Liefray MVC Portlet Singing in before submitting a form
January 30, 2013 5:08 AM
Answer

Gnaniyar Zubair

Rank: Liferay Master

Posts: 603

Join Date: December 19, 2007

Recent Posts

Hi,

MVCPortlet is singing.. emoticon i thought Liferay has new feature to sing a song from MVCPortlet.

Just kidding ... emoticon

BTW, Please set this property in your portal-ext.properties :

1auth.forward.by.last.path=true


By default, it will be "false" and this above property will overwrite the value of "auth.forward.by.last.path" in portal.properties. And it will be taken you to particular page where u were before login.

- Gnaniyar Zubair
Oussama Denden
RE: Liefray MVC Portlet Signing in before submitting a form
January 30, 2013 11:57 AM
Answer

Oussama Denden

Rank: New Member

Posts: 9

Join Date: December 10, 2012

Recent Posts

Hahaha sorry that was a typing mistake but i wasn't able to fix it the site crash every time i try to. But thank you for your quick answer unfortunately it didn't solve the problem after i sign in it take me to the page: "your signed in as...." any other suggestion please???

What i am trying to do is very classic the user will try to fill the form but when he submit we will ask him to sign in first in order to process his request. Once signed in we will process his request accordingly
Oussama Denden
RE: Liefray MVC Portlet Signing in before submitting a form
January 31, 2013 1:29 AM
Answer

Oussama Denden

Rank: New Member

Posts: 9

Join Date: December 10, 2012

Recent Posts

Ok problem solved its due to the Authentication Token more description is available here http://www.liferay.com/community/wiki/-/wiki/Main/Authentication+Token