Virtual Host Login/Logout Properties

This article documents four portal properties that are often used to configure redirection URLs for users.

The four descriptions below include the properties, their descriptions, and examples for:

  1. Configuring the default home URL of the portal

  2. Redirecting a user after logging in

  3. Redirecting a user after logging out

  4. Default user login page

Resolution

1. Configuring the default home URL of the portal

Property:

    company.default.home.url=/web/guest 

Description:

This property sets the default home URL of the portal when a guest user hit the host name. Please use a public page URL as guest users do not have permission to view private pages.

It can also be set via Control Panel > Configuration > Instance Setting > Home URL. The value defined in Instance Setting takes precedence.

The following are a few example scenarios.

First, create a page called test.

Scenario 1

Setting company.default.home.url=/web/guest/home
Setting Home URL configuration=<blank>
Navigating to http://localhost:8080 would show the home page.

Scenario 2

Setting company.default.home.url=/web/guest/home
Setting Home URL configuration=/web/guest/test
Navigating to http://localhost:8080 would show the test page.

Scenario 3

Setting company.default.home.url=/web/guest/test
Setting Home URL configuration=<blank>
Navigating to http://localhost:8080 would show the test page.

Scenario 4

Setting company.default.home.url=/web/guest/test
Setting Home URL configuration=/web/guest/home
Navigating to http://localhost:8080 would show the home page.

2. Redirecting a user after logging in

Property (with description from portal.properties):

##
## Default Landing Page
##

    #
    # Set the default landing page path for logged in users relative to the
    # server path. This is the page users are automatically redirected to after
    # logging in. For example, if you want the default landing page to be
    # http://localhost:8080/web/guest/login, set this to /web/guest/login. To
    # activate this feature, set auth.forward.by.last.path to true. To customize
    # the behavior, see com.liferay.portal.events.DefaultLandingPageAction in
    # the "login.events.post" property above.
    #
    # The following variables can be used: ${liferay:screenName} and
    # ${liferay:userId}.
    #
    default.landing.page.path=
    #default.landing.page.path=/web/guest/login
    #default.landing.page.path=/user/${liferay:screenName}/home

Description:

This configuration can also be set via Control Panel > Configuration > Instance Setting > Default Landing Page.

3. Redirecting a user after logging out

Property (with description from portal.properties):

##
## Default Logout Page
##

    #
    # Set the default logout page path for users relative to the server path.
    # This is the page users are automatically redirected to after logging out.
    # For example, if you want the default logout page to be
    # http://localhost:8080/web/guest/logout, set this to /web/guest/logout. To
    # activate this feature, set auth.forward.by.last.path to true. To customize
    # the behavior, see com.liferay.portal.events.DefaultLogoutPageAction in
    # the "logout.events.post" property above.
    #
    default.logout.page.path=
    #default.logout.page.path=/web/guest/logout

Description:

This configuration can also be set via Control Panel > Configuration > Instance Setting > Default Logout Page.

Please note that the value configured for Default Landing Pange and Default Logout Page in Instance Settings will be stored in PortalPreferences table, which will overwrite the value defined in portal-ext.properties permanently.

4. Default user login page

Property (with description from portal.properties):

    #
    # Enter a URL that will be used to login portal users whenever needed. By
    # default, the portal's login page is used.
    #
    #auth.login.url=/web/guest/home

Description:

This page should be a public page containing a Sign-in portlet and users will be redirected to this page to log in the portal.

Was this article helpful?
1 out of 2 found this helpful