Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • WebSphere Portal Family wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category IBM Redbooks: Building a Sample Website Using IBM Web Content Manager 7.0 IBM Redbooks: Building and Implementing a Social Portal IBM Redbooks: Developing Exceptional Multi-Channel Web Experiences V7: IBM Web Content Manager Product Documentation V7: IBM WebSphere Portal Enable for z/OS Product Documentation V7: IBM WebSphere Portal Express Product Documentation V7: WebSphere Portal Product Documentation V8: IBM Web Content Manager Product Documentation V8: IBM WebSphere Portal Express Product Documentation V8: IBM WebSphere Portal Product Documentation (includes z/OS) Custom Search Scope...
Search
Community Articles > WebSphere Portal > Best Practices for WebSphere Portal > Scenarios for Remember Me Cookie in WebSphere Portal
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

IBM contributorJan-Paul Buchwald
Contribution Summary:
  • Articles authored: 6
  • Articles edited: 3
  • Comments Posted: 8

Recent articles by this author

Implementing a global portlet filter for WebSphere Portal

The JSR 286 portlet specification introduced the concept of portlet filters that allow to hook into or intercept the regular portlet request flow much like servlet filters for servlet applications. According to the specification, those filters are selfcontained within the portlet application and ...

Scenarios for Remember Me Cookie in WebSphere Portal

Version 6.1 of WebSphere Portal introduced the remember me cookie feature, which allows previously logged in Portal users to be identified based on a persistent cookie. Though the basic principle of this feature sounds rather simple, it has a couple of implications and there are multiple scenarios ...

Enforcing SSL for particular WebSphere Portal pages

Using SSL for encryption of the HTTP communication provides protection against network sniffing and man in the middle attacks. The additional protection however comes with performance overhead on both client and server side. In typical Portal scenarios it may be therefore too expensive to protect ...

IBM WebSphere Portal JavaScript API Sample Portlets

This document and attached sample gives an implementation example of an AJAXenriched portlet application to be used with WebSphere Portal 6.1 and newer. The sample shows how to benefit from client side portlet preference handling, background requests using the JSR 286 resource request feature, ...

IBM WebSphere Portal Remote State Service and Fragment Service

This document describes two REST Services available in WebSphere Portal as of version 6.1. The Remote State Service enables you to decode the navigational state information from a given WebSphere Portal URL, or, vice versa, encode an existing XML state representation to a portal URL. The Fragment ...

Community articleScenarios for Remember Me Cookie in WebSphere Portal

Added by IBM contributor Jan-Paul Buchwald | Edited by IBM contributor Jan-Paul Buchwald on July 17, 2011 | Version 12
expanded Abstract
collapsed Abstract
Version 6.1 of WebSphere Portal introduced the remember me cookie feature, which allows previously logged in Portal users to be identified based on a persistent cookie. Though the basic principle of this feature sounds rather simple, it has a couple of implications and there are multiple scenarios depending on the configuration, permission setup, and interrelation with the step-up authentication feature. This article describes the two basic modes for that the remember me cookie feature can be configured, what implications should be considered, and typical scenarios.
Tags:
ShowTable of Contents
HideTable of Contents
  • 1 Terms and definitions
  • 2
This is some text to make the heading work.
  • 2.1 Scenario
  • 2.2 Detailed Use Case Behavior
  • 3
    • 3.0.1 Public vs Protected Pages
    • 3.0.2 Single Sign-On Scenarios
    • 3.0.3 Logout - „Forget Me“
    • 3.0.4 Implications on Administration
  • 3.1 Scenarios
  • 3.2 Detailed Use Case Behavior
  • 4 Summary and Recommendations
  • Terms and definitions

    In the remainder of this article, the following terms will be used without further explanations:
    • Public page/Public portlet: Page or portlet that is configured to be accessed by anonymous Portal users in terms of Portal Access Control.
    • Protected page/protected portlet: Page or portlet that is configured to be accessed by authenticated Portal users in terms of Portal Access Control.
    ==Remember Me Cookie in unauthenticated mode

    This is some text to make the heading work.
    General Description===
    The unauthenticated mode is the default mode when enabling remember me cookie with or without step-up authentication, corresponding to the setting j2eeAuthenticate set to false in the WP RememberMeConfigService resource environment provider (see e.g. Configuring Remember me for J2EE authentication on Linuxexternal link). It means that even when providing a valid remember me cookie, a user is still treated as unauthenticated in terms of Portal Access Control. So the user identified by the remember me cookie will only see the page navigation for public pages (like the anonymous user), and will be prompted to authenticate by user id and password when trying to access a protected page. However, portlets or the Portal theme on public pages can make use of the Portal User Management API (PUMA) to display personalized information based on the user identity provided by the remember me cookie. In particular, the com.ibm.portal.um.PumaProfile.getCurrentUser() method of this API returns the user according to the remember me cookie id when being called from an unauthenticated context. Note that it is not possible to personalize the Portal user experience based on visibility rules for pages or portlets in this case, since attribute based administration is only available to authenticated users (see Attribute Based Administrationexternal link).

    Additionally, the login and the remember me cookie portlet services provide an interface to handle remember me cookies (with operations like getting the cookie user id as a string or generating a URL the user can click to invalidate the cookie). See this developerWorks articleexternal link for more details on those two portlet services.

    The unauthenticated mode of the remember me cookie does not require step-up authentication to be enabled. In fact, unless you have the necessity to provide additional authentication levels than the default ones (standard, identified, authenticated), enabling step-up authentication for this scenario only makes sense if you want to enforce the presence of the remember me cookie for particular public pages or portlets. In that case, you would additionally protect a page or portlet that is available to the anonymous user by the identified step-up authentication level. This would not change the Portal navigation in any way, but ensure that only users with a valid remember me cookie can access the respective page or a page that contains an instance of the respective portlet, and enforce a login with user id and password to deliver a remember me cookie otherwise.

    Scenario

    The unauthenticated mode configuration is suited for scenarios where it is sufficient to handle personalized information for cookie identified users in the theme or in portlets, like e.g. greeting the user by name and displaying personalized recommendations or dashboard information. Every other operation that involves the user identity (like personalized page/portlet preferences, user specific WCM content except for the user name component that is aware of cookie identified users), private credential vault slots, user specific roles or permissions etc.) does require a full login by user name and password.

    Detailed Use Case Behavior

    The following table gives an overview of the behavior of the main use cases when remember me cookie is configured for j2eeAuthenticate=false, and step-up authentication is disabled.

    Behavior with j2eeAuthenticated=false and step-up authentication disabled

    The following table shows the main use cases when remember me cookie is configured for j2eeAuthenticate=false, and step-up authentication is enabled with the default authentication levels (standard, identified, authenticated).

    Note: The use case description consists of a combination of access control+authentication level. Access control provides the distinction between public and protected pages, authentication level means the maximum level on that page (i.e. the highest authentication level that either the page itself or at least one portlet on the page requires). The combination public page+authentication level authenticated is not listed here since it is contradictory and obviously makes no sense. Similarly, the combinations protected page+authentication level identified or authentication level standard (in the case that standard means „unauthenticated“) are not worth to be discussed in this scenario, as the user has to be authenticated by user id and password to access a protected page and thus already has a higher authentication level than identified or no authentication.

    Behavior with j2eeAuthenticated=false and step-up authentication enabled
    ==Remember Me Cookie in authenticated mode

    General Description===
    To enable this mode, you have to explicitly set the setting j2eeAuthenticate to true in the WP RememberMeConfigService resource environment provider (see e.g. Configuring Remember me for J2EE authentication on Linuxexternal link). The setting only comes in combination with enabling step-up authentication and enables the automatic login of users based on the remember me cookie when accessing protected pages that do not require a higher authentication level than identified. In principle, this mode allows a deeper cookie-based personalization experience since the cookie user is treated like being fully authenticated in terms of Portal navigation, page and portlet customizations, and permissions. However, this mode has a couple of implications and requires thorough planning and considerations up-front.

    Public vs Protected Pages

    The cookie-based login only occurs when a protected Portal page is accessed. When accessing a public Portal page with a valid remember me cookie, the behavior is not different from the one described in the previous section for the unauthenticated mode. So Portal still displays the navigation for the anonymous user and allows limited personalization inside the theme and portlets through the PUMA. Running a scenario where users presenting a remember me cookie are always automatically logged in requires additional steps. Currently, there are two solutions for this:
    1. Perform a redirect to the protected area if a public page that has the authentication level identified is accessed and a valid remember me cookie is presented. This makes sure that at least for all pages protected with the identified level, an automatic login based on the remember me cookie occurs. If no remember me cookie is present, the user is challenged for a full login by user id and password. To achieve this behavior, add or modify the following properties in the WP StepUpConfigService resource environment provider:
      • name: sua.authLevel.identified.authLevelVerifier
        type: String
        value: com.ibm.wps.auth.sua.impl.AuthLevelVerifierRememberMeJ2EEb)
      • name: sua.authLevel.identified.stepUpAuthHandler
        type: String
        value: com.ibm.wps.auth.sua.impl.StepUpAuthHandlerRememberMeJ2EEc)
      • name: sua.authLevel.identified.postRedirectionTargetProtected
        type: Boolean
        value: true
      The settings require a server/cluster restart to become effective.
    2. Always trigger a redirect to the according protected page if a public page is accessed and a remember me cookie is presented, independently of the authentication level set on the page. This requires a customized component that is described in a |separate wiki articleexternal link in more detail.

    In general, logging in the user automatically based on the cookie may lead to a very high number of logins in large scale scenarios, which should be reflected in the performance and capacity planning.

    Single Sign-On Scenarios

    The Portal triggers a full login for the cookie user, leading to a full WebSphere security context to be created. After that, only a WebSphere Portal server with the same step-up authentication configuration will properly enforce a second login with user id and password (or another custom authentication level) if this is necessary. All other components in the same Single-Sign On (SSO) domain will by default not understand what proof of identity was used to establish the security context and treat the user as fully authenticated. However, the information about the authentication method is available in the security subject, and can be evaluated by other components in the same SSO domain. The current authentication method is stored as an additional attribute com.ibm.wsspi.sec.cred.authMethod to the LTPA token 2 ssoToken in the private credentials of the security subject. Possible values are „identified“ for the remember me cookie authentication, and „basic“ for the user id and password authentication. An appendix at the end of the article provides a code snippet that shows how a custom login module or code in an application could read the authentication level from the WebSphere security subject in order to use it for additional enforcement checks.

    Logout - „Forget Me“

    In all of the described scenarios and configuration alternatives, WebSphere Portal does not invalidate the remember me cookie upon logout. This behavior is intended, but requires attention in the case of the authenticated mode, especially if one of the solutions for automatic login based on the cookie is configured. Depending on the overall scenario, it might be necessary to add custom logic to invalidate the remember me cookie upon logout to prevent that the user is logged back in immediately by presenting a remember me cookie. An example that achieves this by employing a custom logout filter is also contained in the previously mentioned wiki articleexternal link.

    Implications on Administration

    By default, pages and portlets have the authentication level standard. The actual value of this level depends on the resource's access control settings. Protected resources that are not accessible to the anonymous user get the level authenticated, meaning that those resources require a full login by user id and password. So additional administrative steps in the Portal may be necessary to make sure those resources that are intended to be accessible after a cookie-based login without another authentication challenge are protected with the identified or a lower authentication level.

    Also note that using attribute based administration (i.e. visibility rules for pages and portlets) adds a third dimension for controlling access in addition to access control and step-up authentication. In general, it is recommended thoroughly check whether any of the two additional dimensions step-up authentication and visibility rules can be avoided in a particular scenario, since each adds another layer of administrative complexity to the solution.

    Scenarios

    Overall, the authenticated mode configuration for the remember me cookie is suited for scenarios where the identity from the remember me cookie already counts as a means of authentication that allows users to see and use their individual personalized Portal page structure and preferences. Particular pages and portlets can additionally be protected by other authentication methods (by default user id and password) using the step-up authentication framework.

    Detailed Use Case Behavior

    The following table gives an overview of the different use cases and the resulting behavior for the j2eeAuthenticate =true and step-up authentication enabled setup. Note that in this case the combination protected page+authentication level identified is viable, since this is exactly the case where an automatic login occurs if a valid remember me cookie is presented.

    Behavior with j2eeAuthenticated=true and step-up authentication enabled

    * With additional configuration settings / customizations described in a previous section, this case can be modified in a way that an automatic redirect to the protected Portal area is triggered.

    Summary and Recommendations

    This article highlighted the different configuration modes for the remember me cookie functionality in Portal, and the dependency of this feature to access control and step-up authentication. Overall, when planning to use the remember me cookie functionality, the easiest and most straight-forward way is to use the default unauthenticated mode without enabling step-up authentication. With that configuration, portlets and/or the theme must be implemented in a way that they handle cookie-based personalization properly by using PUMA when running on public pages, displaying general information for the anonymous user if no remember me cookie is present, and personalized information for the cookie user if a valid cookie is provided. This is both recommended for performance reasons (saving the potentially high number of logins based on the cookie), and security reasons (avoiding the SSO impact of creating a full security context for users that are only identified by cookie). Only if the performance and security implications are well understood and mitigated, it is viable to use the authenticated mode for providing a deep personalization experience for users based on the remember me cookie.

    ==Appendix Reading the authentication level from the security subject==
    The following code snippet shows how to read the authentication method from the WebSphere subject as it is present after a login triggered by WebSphere Portal with the step-up authentication feature enabled. The code can be run in any WebSphere application or custom component (like a JAAS login module). Possible values returned can be „basic“ (for user id/password authentication) and „identified“ (for remember me cookie based authentication).

    {code:||600|600}

    import java.util.Iterator;
    import java.util.Set;
    import com.ibm.websphere.security.WSSecurityException;
    import javax.security.auth.Subject;
    import com.ibm.websphere.security.auth.WSSubject;
    import com.ibm.wsspi.security.token.SingleSignonToken;
     
    protected String getAuthLevelFromLTPAToken2() throws WSSecurityException {
      String authLevel = null;
      Subject subject = WSSubject.getRunAsSubject();
      if (subject != null) {
        // get all single sign-on tokens and select the LTPA token 2
        Set ssoTokens = subject.getPrivateCredentials(SingleSignonToken.class);
        if (ssoTokens != null) {
            for (Iterator iter = ssoTokens.iterator(); iter.hasNext();) {
                SingleSignonToken ssoToken = (SingleSignonToken) iter.next();
                // check whether it is the LTPA token 2
                    if ("LtpaToken".equals(ssoToken.getName()) && ssoToken.getVersion() == 2) {
                        // obtain the auth method from the ltpa token 2
                        String[] authMethods = ssoToken.getAttributes(TOKEN_ATTR_AUTH_METHOD);
                        if (authMethods != null && authMethods.length > 0) {
                            authLevel = authMethods[0];
                        }
                   }
             }
        }
      return authLevel;
    }
    {code}
    expanded Attachments (0)
    collapsed Attachments (0)
    expanded Versions (27)
    collapsed Versions (27)
    Version Comparison     
    VersionDateChanged by              Summary of changes
    27Jul 22, 2011 2:20:30 AMMatthias X Falkenberg  IBM contributorAdded a couple tags
    26Jul 22, 2011 2:15:50 AMMatthias X Falkenberg  IBM contributorMinor change
    25Jul 21, 2011 1:05:44 PMJan-Paul Buchwald  IBM contributor
    24Jul 21, 2011 12:59:49 PMJan-Paul Buchwald  IBM contributorMinor change
    23Jul 20, 2011 4:11:51 PMJan-Paul Buchwald  IBM contributorMinor change
    22Jul 20, 2011 4:09:36 PMJan-Paul Buchwald  IBM contributorMinor change
    21Jul 20, 2011 4:08:25 PMJan-Paul Buchwald  IBM contributorMinor change
    20Jul 18, 2011 3:03:44 AMMatthias X Falkenberg  IBM contributorMinor change
    19Jul 18, 2011 3:00:55 AMMatthias X Falkenberg  IBM contributorLittle rephrasing, numbering, and formatting in general
    18Jul 17, 2011 9:42:18 AMJan-Paul Buchwald  IBM contributorMinor change
    17Jul 17, 2011 9:41:13 AMJan-Paul Buchwald  IBM contributorMinor change
    16Jul 17, 2011 9:34:20 AMJan-Paul Buchwald  IBM contributor
    15Jul 17, 2011 9:21:09 AMJan-Paul Buchwald  IBM contributorMinor change
    14Jul 17, 2011 9:18:36 AMJan-Paul Buchwald  IBM contributorMinor change
    13Jul 17, 2011 9:15:48 AMJan-Paul Buchwald  IBM contributorMinor change
    This version (12)Jul 17, 2011 9:13:03 AMJan-Paul Buchwald  IBM contributorMinor change
    11Jul 17, 2011 9:10:45 AMJan-Paul Buchwald  IBM contributorMinor change
    10Jul 17, 2011 9:06:03 AMJan-Paul Buchwald  IBM contributorMinor change
    9Jul 17, 2011 9:02:20 AMJan-Paul Buchwald  IBM contributorMinor change
    8Jul 17, 2011 8:44:16 AMJan-Paul Buchwald  IBM contributorMinor change
    7Jul 17, 2011 8:41:55 AMJan-Paul Buchwald  IBM contributorMinor change
    6Jul 17, 2011 8:40:07 AMJan-Paul Buchwald  IBM contributorMinor change
    5Jul 17, 2011 8:36:50 AMJan-Paul Buchwald  IBM contributorMinor change
    4Jul 17, 2011 8:35:48 AMJan-Paul Buchwald  IBM contributorMinor change
    3Jul 17, 2011 8:33:32 AMJan-Paul Buchwald  IBM contributorMinor change
    2Jul 17, 2011 8:32:22 AMJan-Paul Buchwald  IBM contributorMinor change
    1Jul 17, 2011 8:30:36 AMJan-Paul Buchwald  IBM contributor
    Copy and paste this wiki markup to link to this article from another article in this wiki.
    Go ElsewhereStay ConnectedHelpAbout
    • IBM Collaboration Solutions wikis
    • IBM developerWorks
    • IBM Software support
    • Twitter LinkIBMSocialBizUX on Twitter
    • FacebookIBMSocialBizUX on Facebook
    • ForumsLotus product forums
    • BlogsIBM Social Business UX blog
    • Community LinkIBM Collaboration Solutions
    • Wiki Help
    • Forgot user name/password
    • Wiki design feedback
    • Content feedback
    • About the wiki
    • About IBM
    • Privacy
    • Accessibility
    • IBM Terms of use
    • Wiki terms of use