回答我的問題,因爲我終於想通了......
我創建了一個掛鉤,以取代JSP文件$TOMCAT/webapps/ROOT/html/portlet/login/login.jsp
其中$TOMCAT
是Liferay的捆綁Tomcat服務器目錄。 (檢查Liferay guide關於如何創建JSP掛鉤。)
想法是測試CAS是否啓用,如果是,則「隱藏」表單中的用戶名,密碼字段和登錄按鈕。我在Liferay Shibboleth插件中找到的測試條件。以下是JSP的相關部分,從101行開始:
<liferay-ui:error exception="<%= UserPasswordException.class %>" message="authentication-failed" />
<liferay-ui:error exception="<%= UserScreenNameException.class %>" message="authentication-failed" />
<%-- When CAS is enabled, don't show the normal login fields --%>
<c:choose>
<c:when test="<%= PrefsPropsUtil.getBoolean(company.getCompanyId(), PropsKeys.CAS_AUTH_ENABLED, PropsValues.CAS_AUTH_ENABLED) %>" >
<%-- CAS is enabled --%>
<div><p>
Please sign in via CAS using the "Sign In" link in the upper right corner.
</p></div>
</c:when>
<c:otherwise> <%-- original login fields --%>
<aui:fieldset>
<%
String loginLabel = null;
if (authType.equals(CompanyConstants.AUTH_TYPE_EA)) {
loginLabel = "email-address";
}
else if (authType.equals(CompanyConstants.AUTH_TYPE_SN)) {
loginLabel = "screen-name";
}
else if (authType.equals(CompanyConstants.AUTH_TYPE_ID)) {
loginLabel = "id";
}
%>
<aui:input label="<%= loginLabel %>" name="login" showRequiredLabel="<%= false %>" type="text" value="<%= login %>">
<aui:validator name="required" />
</aui:input>
<aui:input name="password" showRequiredLabel="<%= false %>" type="password" value="<%= password %>">
<aui:validator name="required" />
</aui:input>
<span id="<portlet:namespace />passwordCapsLockSpan" style="display: none;"><liferay-ui:message key="caps-lock-is-on" /></span>
<c:if test="<%= company.isAutoLogin() && !PropsValues.SESSION_DISABLED %>">
<aui:input checked="<%= rememberMe %>" inlineLabel="left" name="rememberMe" type="checkbox" />
</c:if>
</aui:fieldset>
<aui:button-row>
<aui:button type="submit" value="sign-in" />
</aui:button-row>
</c:otherwise>
</c:choose>
<%-- end of CAS-dependent login field part --%>
</aui:form>
無可否認,這是一種黑客行爲,但它起作用。 :-)
警告:Liferay患有JavaEE疾病,以不必要的複雜方式解決簡單問題,文檔不夠詳細。與例如內容管理部分相比,內容管理部分笨拙。 TYPO3的。 DB後端實現令人恐懼:數據庫中沒有引用完整性約束,所有配置參數都被轉儲到一個XML格式的字符串條目中,而不是具有2列「params」和「values」的表格,如同任何理智的設計人員所擁有的做到了...如果可以的話避免。 –
嗨,你是如何設法將密碼首次輸出到ldap的。只有當我使用登錄portlet登錄並重置密碼時,纔會爲我輸出密碼 – sree
@sree感謝您提出問題,但幸運的是,我的情況發生了變化,我不必再用這個熱氣騰騰的s ***工作: - )因此我無法回答你的問題。讓我重複我的上述建議:如果可以,請避免使用此軟件。 –