LRP-614 practice question 9 of 25

The recommended way to implement a new SSO solution that captures the SSO header is to:

Full set: 144 questions
Answer options
A: Create an Ext plugin that adds a sen/let filter to capture the SSO header
B: Create a hook plugin that implements a servlet filter to capture the SSO header Correct answer
C: Modify the portal source code and create an SSO servlet filter in the portal to capture the SSO header
D: Create a hook plugin to override the Struts action for the Login portlet to capture the SSO header
Correct Answer:
B. Create a hook plugin that implements a servlet filter to capture the SSO header
Explanation

The recommended and most appropriate method for implementing a custom, header-based SSO solution is to use a hook plugin to deploy a servlet filter. A servlet filter is the standard Java EE mechanism for intercepting requests, allowing inspection of headers before they are processed by the portal. Liferay's hook plugin architecture is specifically designed to allow such customizations in a modular, non-invasive, and upgrade-friendly manner. This approach correctly separates the custom SSO logic from the portal's core code, adhering to Liferay's development best practices.

Why Incorrect

A. An Ext plugin is too invasive for this task. Liferay best practices dictate using the least invasive plugin type possible, and a hook is fully capable of deploying a servlet filter.
C. Directly modifying the portal source code is strongly discouraged. This practice makes future upgrades extremely difficult and is not a sustainable or recommended development approach.
D. Overriding a Struts action is not suitable for SSO. An SSO mechanism must check every incoming request for authentication credentials, whereas a Struts action only fires for a specific user interaction. ---

References

1. Liferay Portal 6.2 Developer's Guide, Chapter 7: "Customizing Liferay with Hooks".

Reference: The section "Using Servlet Filters with a Hook" explicitly details the procedure for creating and deploying a servlet filter via a hook plugin. It states, "You can use a hook to add a servlet filter to Liferay’s chain of servlet filters." This confirms that a hook is the intended mechanism for this task.

2. Liferay Portal 6.2 Developer's Guide, Chapter 8: "Advanced Liferay Development with the Ext Plugin".

Reference: The introductory section warns, "The Ext plugin is the most powerful of Liferay’s plugins, but it’s also the most invasive... You should only use an Ext plugin when you can’t use a hook." This supports the rejection of option A as the "recommended" way.

3. Liferay Portal 6.2 Developer's Guide, Chapter 12: "Single Sign On".

Reference: This chapter discusses Liferay's SSO architecture, including the AutoLogin hook interface. While an AutoLogin hook is part of a complete SSO solution (to perform the actual login), the initial step of capturing credentials from a request header is best handled by a servlet filter, which then passes the information to the AutoLogin implementation. This contextualizes the servlet filter's role as the correct entry point for the process described in the question.

Scroll to Top