Showing posts with label realm. Show all posts
Showing posts with label realm. Show all posts

Configuring Realm support

I wanted to learn how to use the realm support but i do have only one LDAP server, so i decided that i will create two realms first realm will have all the users from my LDAP other realm would have all users from my file based repository and my default realm has users from both LDAP and file based repository.

Important NOteEnsure that the distinguished names and the logon attributes are unique among the different LDAP servers that you configure to use same LDAP server

I followed these steps to try the realm support


  • First i configured my Portal to Add LDAP user registry in my federated user repository. By default portal is configured to use federated user repository

  • Now log into the WebSphere Application Server and take a look at the configuration of defaultWIMFileBasedRealm. As you can see it is configured to use both file InternalFileRepository as well adminldap repository.

  • Now lets configure ldap user based repository. In order to do that create addrealm.properties file like this

    realmName=ldaprealm
    securityUse=active
    delimiter=/
    addBaseEntry=dc=ibm,dc=com

    In this file value of realmName is the name that you want to give to this realm and value of addBaseEntry is one that you see as value of Base Entry for that repository in the WAS Admin Console

  • Now execute this configuration task to create ldap realm

    ./ConfigEngine.sh wp-create-realm -DWasPassword=wasadmin -DparentProperties=/software/WebSphere/wp_profile/ConfigEngine/config/helpers/addrealm.properties


  • Once the build is successful restart the WebSphere_Portal server

  • Now next step is to configure base for users and accounts for this realm. Create modifyrealmparent.properties file like this

    realmName=ldaprealm
    realm.personAccountParent=cn=users,dc=ibm,dc=com
    realm.groupParent=cn=groups,dc=ibm,dc=com
    realm.orgContainerParent=dc=ibm,dc=com

    If your not sure about what these values should be you can look for them in WAS Admin Console



  • Now execute following configuration task

    ./ConfigEngine.sh wp-modify-realm-defaultparents -DWasPassword=wasadmin -DparentProperties=/software/WebSphere/wp_profile/ConfigEngine/config/helpers/modifyrealmparents.properties


  • Restart the WebSphere_Portal server for your changes to take effect

  • At this point my ldap realm is ready so i will create a new LDAP vritual portal that will only allow users from LDAP server to login. Go to Manage Virtual Portal and create LDAP Virtual portal like this




Now go to http://localhost:10040/wps/portal/ldap and you should be able to login with user configured in LDAP but not with users from filesystemrepository.

You can follow same steps to create fileSystembase reposority

Virtual Portal Realm

WebSphere Portal has this concept of realms based on federated repository. Realm allows you to create sub group of users from all your repositories, Ex. you can create a realm which only has users from say File System based User Repository or create a Second realm that only has users from one of your LDAP server. Once you create this realm you can attach it to virtual portal so that only users from that sub group can login into the virtual Portal.

Ex. In your organization you have 2 LDAP's one IBM Tivoli directory server is maintained by sales team that has entries for all the employees from Sales department. The finance team is using say Active directory server that has entries for Finance department employees. Now you want to configure your Portal Server to host one Virtual portal for Sales team and one virtual portal for Finance team. You want to configure it so that only employees from Sales team would be allowed to login into sales virtual portal and employees from Finance team would be allowed to access Finance portal. There is third employee virtual portal that both finance and sales team employees can access.

You can use Federated repository + Realms to solve this use case. By default portal is configured to use Federated User repository and it has only one File base user repository as it is member, you can configure it to add both sales and finance department LDAP user repository under the federated user repository. Once that is done you can create 3 different realms one is Sales Realm which is configured to use Sales LDAP Server, other would be Finance Realm that would be configured to use only user from finance ldap and third would be employee realm that contains users from both Sales and Finance LDAP. Once this is done you can create 3 virtual portal and use appropriate realms for them

These are some of the important points related to realms


  • A realm contains the entire user population of one virtual portal.

  • Each virtual portal can have its own realm of users associated, but it is also possible that multiple virtual portals can share their user population by using the same realm in parallel.

  • In order to be able to log in to a particular virtual portal, a user must be a member of the realm that is associated with that virtual portal.

  • A virtual portal is associated with one realm. Each virtual portal uses exactly one realm, but a realm can be used by multiple virtual portals.

  • A virtual portal can also be associated with no realm. If no realm is assigned for a virtual portal, the user population that was defined for the super realm can log on to the virtual portal.

  • The individual user IDs must be unique across all realms.

  • In order to log in to a virtual portal, the virtual portal administrator and all users must be a member of the realm for that virtual portal. To allow a user access to more than one virtual portal, that user (and thereby the Virtual Member Manager node to which the user belongs in the hierarchy of the user directory) must be a member of all the realms associated with these virtual portals. For example, this applies to a super administrator who is responsible for all virtual portals within an entire Portal installation.

  • In order to administer the virtual portals, the master administrator must be a member of the realms of these virtual portals.

  • User populations of realms can overlap. In other words, users can be members of multiple realms. If realms overlap, that is if some users are in different realms for different virtual portals, then these users can work in all the virtual portals which are associated with these realms.



By default WebSphere Portal is configured with Federated Repositories as User Registry provider. By default only the super realm, or default realm, is configured. After you have configured your portal instance against your user backend repositories you can use tasks provided by the portal to configure the realms


When users access a virtual portal, the portal installation selects the appropriate realm based on the current virtual portal context. Within a virtual portal, only users of that corresponding realm are "visible". The administrator of a particular virtual portal can only give access rights to users and groups in the population of that virtual portal. Therefore, when you create a virtual portal, the realm that represents the population of the new virtual portal must be a subset of the realm used by your portal installation.