Forums

Home » Liferay Portal » Deutsch

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Flo We
Custom Login in Liferay 6
January 18, 2011 1:52 AM
Answer

Flo We

Rank: Junior Member

Posts: 45

Join Date: January 12, 2011

Recent Posts

Hallo Liferay Community,

ich habe in meinem Liferay Portal ein Custom Login eingebaut indem ich ganz banal die Logindaten an das Hidden Login Portlet mit einer redirect Anweisung weiterleite:
 1
 2String loginURL =
 3       DpUtils.getHttpsBaseUrl(request)
 4       + "/web/guest/hiddenlogin?p_p_id=58&p_p_lifecycle=1&saveLastPath=0&_58_struts_action=%2Flogin%2Flogin"
 5       + "&login="
 6       + URLEncoder.encode(login, "UTF-8")
 7       + "&password="
 8       + URLEncoder.encode(password, "UTF-8")
 9       + "&_58_rememberMeCheckbox=1&_58_redirect="
10       + DpUtils.getHttpsBaseUrl(request)
11       + "/web/guest/";
12response.sendRedirect(loginURL);


Dies hat mit Liferay 5.2 auch wunderbar funktioniert.
Nach dem Update auf die Liferay Version 6 habe ich aber folgendes Problem:
Wenn ich die Login Anfrage abschicke wird der Liferay Benutzer zwar eingeloggt, anstelle des Redirects kommt aber ein interner Serverfehler: Eine Störung trat beim Zurückgreifen auf das erbetene Hilfsmittel auf.

Durch ausprobieren konnte ich das Problem auf den URL-Parameter p_p_lifecycle=1 zurückführen. Entferne ich diesen Parameter aber aus der Redirect-URL werde ich nur noch zum regulären Login-Portlet geleitet ohne das der Benutzer eingeloggt wird.

Hätte jemand eine Idee woran dies liegen könnte? Leider habe ich zum Thema Custom Login nur den Weg über EXT gefunden, der für meinen momentanen Wissensstand noch etwas zu komplex scheint.
Tobias Käfer
RE: Custom Login in Liferay 6
January 18, 2011 2:47 AM
Answer

Tobias Käfer

Rank: Regular Member

Posts: 128

Join Date: March 28, 2008

Recent Posts

Hallo,

das ist jetzt mehr eine Vermutung, aber vielleicht hängt das ja auch mit dem in Liferay eingeführen Redirect-Filter zusammen, siehe auch diesen Thread: http://www.liferay.com/de/community/forums/-/message_boards/message/4950566#_19_message_4950566

Grüße
Tobias
Flo We
RE: Custom Login in Liferay 6
January 24, 2011 2:51 AM
Answer

Flo We

Rank: Junior Member

Posts: 45

Join Date: January 12, 2011

Recent Posts

Hallo,

danke für die Antwort!
Ich habe mir das Thema jetzt durchgelesen, das konnte mir aber leider auch nicht weiterhelfen.
Auf den ersten Blick scheint dies zwar mein Problem zu sein, es gibt aber auf den zweiten Blick auch größere Unterschiede wie z.B. das bei mir nicht mydomain.com/web/guest/null als Seite steht.

Ich habe trotzdem versucht die beschriebene Lösung in allen Formen anzuwenden, was aber nicht geholfen hat.

Ich habe auch noch herausgefunden, das folgender Eintrag in die Logdatei des Servers geschrieben wird, wenn der Fehler auftaucht:
  1javax.portlet.WindowStateException:
  2    at com.liferay.portlet.StateAwareResponseImpl.setWindowState(StateAwareResponseImpl.java:243)
  3    at com.liferay.portlet.StateAwareResponseImpl.init(StateAwareResponseImpl.java:278)
  4    at com.liferay.portlet.ActionResponseFactory.create(ActionResponseFactory.java:38)
  5    at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:761)
  6    at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:571)
  7    at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:229)
  8    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
  9    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
 10    at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:152)
 11    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
 12    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
 13    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
 14    at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:508)
 15    at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:485)
 16    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 17    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 18    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 19    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 20    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
 21    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 22    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 23    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 24    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
 25    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 26    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 27    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 28    at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:309)
 29    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
 30    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 31    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 32    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 33    at com.liferay.portal.servlet.filters.themepreview.ThemePreviewFilter.processFilter(ThemePreviewFilter.java:88)
 34    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
 35    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 36    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 37    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 38    at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:137)
 39    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
 40    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 41    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 42    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 43    at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:182)
 44    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
 45    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 46    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 47    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 48    at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:254)
 49    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
 50    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 51    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 52    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
 53    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
 54    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
 55    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
 56    at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:133)
 57    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 58    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 59    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 60    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 61    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
 62    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 63    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 64    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 65    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
 66    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 67    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 68    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 69    at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:261)
 70    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
 71    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 72    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 73    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 74    at com.liferay.portal.servlet.filters.themepreview.ThemePreviewFilter.processFilter(ThemePreviewFilter.java:88)
 75    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
 76    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 77    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 78    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 79    at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126)
 80    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
 81    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 82    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 83    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 84    at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:182)
 85    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
 86    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 87    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 88    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 89    at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:221)
 90    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
 91    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 92    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 93    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 94    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
 95    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 96    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 97    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 98    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
 99    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
100    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
101    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
102    at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:45)
103    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
104    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
105    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
106    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
107    at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:254)
108    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
109    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
110    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
111    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
112    at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:81)
113    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
114    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
115    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
116    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
117    at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:179)
118    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
119    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
120    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
121    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
122    at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:239)
123    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
124    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
125    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
126    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
127    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
128    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
129    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
130    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
131    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
132    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
133    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
134    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
135    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
136    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
137    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
138    at com.liferay.portal.servlet.filters.threadlocal.ThreadLocalFilter.processFilter(ThreadLocalFilter.java:35)
139    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
140    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
141    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
142    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
143    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
144    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
145    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
146    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
147    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
148    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
149    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
150    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
151    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
152    at java.lang.Thread.run(Thread.java:619)


Dieser Fehler wird laut Beschreibung des LoginUtils von der Funktion getLoginURL ausgelöst.

Jetzt stellt sich mir allerdings die Frage:
Was hat das Windows State (Welches laut http://portals.apache.org/pluto/portlet-2.0-apidocs/javax/portlet/WindowState.html MINIMIZED, MAXIMIZED oder NORMAL ist) mit dem Parameter "p_p_lifecycle=1" zu tun? (Wenn ich den Parameter p_p_lifecycle=1 von der URL entferne, werde ich zum Login-Portlet weitergeleitet ohne das mich Liferay einlogt)
Flo We
RE: Custom Login in Liferay 6
January 24, 2011 8:35 AM
Answer

Flo We

Rank: Junior Member

Posts: 45

Join Date: January 12, 2011

Recent Posts

Hallo,

ich habe noch ein bisschen rumgespielt und das DpUtils.getHttpsBaseUrl(request) entfernt. Dies ermittelt die Domäne für die URL.

Danach funktioniert es.