legacy-knowledge-base
公開されました Jul. 2, 2025

保護されたページまたはリソースにアクセスしようとするときに、ゲスト ユーザーがログイン ページにアクセスできないように制限する

written-by

Katlyn Lee

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

問題

  • デフォルトでは、ゲスト ユーザーが URL にアクセスしようとしたり、保護されていてゲスト ユーザーが利用できないリソースにアクセスしようとすると、ログイン ページが表示されます。 ゲスト ユーザーをログイン ページにリダイレクトさせたくありません。

Environment

  • Liferay Portal
  • Liferay DXP

解決策

  • 次のポータル プロパティを利用して、保護されたリソースにアクセスしようとしたときにゲスト ユーザーをログイン ページにリダイレクトするデフォルトの動作を変更します。

    # Enter a URL that will be used to login portal users whenever needed. 
    # By default, the portal's login page is used. # # Env: LIFERAY_AUTH_PERIOD_LOGIN_PERIOD_URL # #auth.login.url=/web/guest/home # # Set this to true to prompt a guest user to login when attempting
    # to access a protected page resource in the portal. By setting this
    # value to false, the portal will inform all users that a requested
    # resource is not found if they have no entitlements to view the
    # resource. The portal will not prompt for login even if the user
    # is a guest user. This behavior complies with OWASP best practices. # # Env: LIFERAY_AUTH_PERIOD_LOGIN_PERIOD_PROMPT_PERIOD_ENABLED # auth.login.prompt.enabled=true # # Enter a friendly URL of a page that will be used to login portal users # whenever the user is navigating a site and authentication is needed.
    # By default, the portal's login page or the URL set in the property # "auth.login.url" is used. # # Env: LIFERAY_AUTH_PERIOD_LOGIN_PERIOD_SITE_PERIOD_URL # auth.login.site.url=/login

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base