legacy-knowledge-base
Publicado Sep. 25, 2010

CAPTCHA_TEXT Not Set In The Portlet Session

written-by

Apsara Raheja

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • While validating the captcha in the custom module, the following exception shows:

    "CAPTCHA text is null. User null may be trying to circumvent the CAPTCHA."

  • Steps to reproduce:
    1. Deploy my-test-captcha-1.0.0.jar. This is located in the /build/lib.

    2. Add it to a page, as a widget. It's under Sample, or you can search for it.

    3. Input an email and the Captcha text.

    Actual Result: CAPTCHA Verification will fail.
    Expected Result: CAPTCHA Verification is successful.
    Note: This only happens with a custom captcha portlet, the captcha components from the portal (Example: "forgot password" page) are working as expected.

Environment

  • Liferay DXP 7.4

Resolution

  • Previously, there were 2 methods named as serveImage in CaptchaUtil:

    # method 1:
    serveImage(ResourceRequest resourceRequest, ResourceResponse resourceResponse)

    # method 2:
    serveImage(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)

  • However, this LPS-181665: Remove method references in CaptchaUtil removed method 1, and only method 2 is available now, therefore all usages of method 1 should be adapted to invoke method 2 only.
  • This has been addressed in LPS-196214.

Additional Information

did-this-article-resolve-your-issue

legacy-knowledge-base