{"id":2707,"date":"2014-01-21T18:07:10","date_gmt":"2014-01-21T10:07:10","guid":{"rendered":"http:\/\/rmohan.com\/?p=2707"},"modified":"2014-01-21T19:01:39","modified_gmt":"2014-01-21T11:01:39","slug":"using-wsadmin-to-enable-an-ldap-federated-repository-in-websphere-application-server-8-5","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=2707","title":{"rendered":"Using wsadmin to enable an LDAP Federated Repository in WebSphere Application Server 8.5"},"content":{"rendered":"<h3 itemprop=\"name\">Using wsadmin to enable an LDAP Federated Repository in WebSphere Application Server 8.5<\/h3>\n<div><\/div>\n<p><span style=\"font-family: Arial;\">This article is somewhat of an <i>aide memoire<\/i>\u00a0for me, allow me to remember how to enable WebSphere Application Server to talk to an LDAP server, without needing to use a GUI \ud83d\ude42<\/span><\/p>\n<div><span style=\"font-family: Arial;\">\u00a0<\/span><\/div>\n<div>\n<div><span style=\"font-family: Arial; font-size: medium;\">I pulled this together using my own WAS 8.5 VM running on RHEL 6.3, as ever, and a remote LDAP ( albeit IBM Tivoli Directory Server rather than Microsoft Active Directory ).<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">Start wsadmin client<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">$ <i>cd \/opt\/IBM\/WebSphere\/AppServer\/profiles\/Dmgr01\/bin<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">$ <i>.\/wsadmin.sh -lang jython<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">List existing repositories<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.listIdMgrRepositories()<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">should return: &#8211;<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Courier; font-size: medium;\">&#8216;{InternalFileRepository={repositoryType=File, host=LocalHost}}&#8217;<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">Configure the Administrative User Registry ( assume that we&#8217;re keeping the WAS admin in file-based registry )<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.configureAdminWIMUserRegistry(&#8216;[-realmName defaultWIMFileBasedRealm -verifyRegistry false ]&#8217;)<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">Add the LDAP server<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.createIdMgrLDAPRepository(&#8216;[-default true -id LDAP1 -adapterClassName com.ibm.ws.wim.adapter.ldap.LdapAdapter -ldapServerType IDS -sslConfiguration -certificateMapMode exactdn -supportChangeLog none -certificateFilter -loginProperties uid]&#8217;)\u00a0<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.addIdMgrLDAPServer(&#8216;[-id LDAP1 -host <a href=\"http:\/\/bluepages.ibm.com\">bluepages.ibm.com<\/a> -port 389 -bindDN uid=8817222GB,c=gb,ou=bluepages,o=ibm.com -bindPassword passw0rd! -referal ignore -sslEnabled false -ldapServerType IDS -sslConfiguration -certificateMapMode exactdn -certificateFilter]&#8217;)<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.updateIdMgrLDAPRepository(&#8216;[-id LDAP1 -loginProperties [&#8220;&#8221;]]&#8217;)<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.updateIdMgrLDAPRepository(&#8216;[-id LDAP1 -adapterClassName com.ibm.ws.wim.adapter.ldap.LdapAdapter -ldapServerType IDS -sslConfiguration -certificateMapMode exactdn -certificateFilter -supportChangeLog none -loginProperties uid]&#8217;)<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">Add the Base Entries<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.addIdMgrRepositoryBaseEntry(&#8216;[-id LDAP1 -name o=ibm.com -nameInRepository o=ibm.com]&#8217;)<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.addIdMgrRealmBaseEntry(&#8216;[-name defaultWIMFileBasedRealm -baseEntry o=ibm.com]&#8217;)\u00a0<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">Validate the Admin Name ( wasadmin in file-based registry )<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.validateAdminName(&#8216;[-registryType WIMUserRegistry -adminUser wasadmin ]&#8217;)<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">Enable Global Security and set Federated Repositories to be default<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.setAdminActiveSecuritySettings(&#8216;[-activeUserRegistry WIMUserRegistry -enableGlobalSecurity true]&#8217;)<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">Set the LDAP search filters<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.updateIdMgrLDAPEntityType(&#8216;[-id LDAP1 -name PersonAccount -objectClasses inetOrgPerson -searchBases ou=bluepages,o=ibm.com -searchFilter ]&#8217;)\u00a0<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">Save changes<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminConfig.save()<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">Validate changes<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.listIdMgrRepositories()<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">should return: &#8211;<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Courier; font-size: medium;\">&#8216;{InternalFileRepository={repositoryType=File, host=LocalHost}, LDAP1={repositoryType=LDAP, specificRepositoryType=IDS, host=bluepages.ibm.com}}&#8217;<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">wsadmin&gt; <i>AdminTask.listIdMgrRepositoryBaseEntries(&#8216;[-id LDAP1]&#8217;)<\/i><\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">should return: &#8211;<\/span><\/div>\n<div><span style=\"font-family: Arial; font-size: medium;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: Courier; font-size: medium;\">&#8216;{o=ibm.com=o=ibm.com}&#8217;<\/span><\/div>\n<div><\/div>\n<div><\/div>\n<div><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2014\/01\/Image-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2719\" alt=\"Image 1\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2014\/01\/Image-1.png\" width=\"1280\" height=\"800\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-1.png 1280w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-1-300x187.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-1-1024x640.png 1024w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-1-150x93.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-1-400x250.png 400w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-1-900x562.png 900w\" sizes=\"(max-width: 1280px) 100vw, 1280px\" \/><\/a> <a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2014\/01\/Image-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2720\" alt=\"Image 2\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2014\/01\/Image-2.png\" width=\"1280\" height=\"800\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-2.png 1280w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-2-300x187.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-2-1024x640.png 1024w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-2-150x93.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-2-400x250.png 400w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-2-900x562.png 900w\" sizes=\"(max-width: 1280px) 100vw, 1280px\" \/><\/a> <a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2014\/01\/Image-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2721\" alt=\"Image 3\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2014\/01\/Image-3.png\" width=\"1280\" height=\"800\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-3.png 1280w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-3-300x187.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-3-1024x640.png 1024w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-3-150x93.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-3-400x250.png 400w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-3-900x562.png 900w\" sizes=\"(max-width: 1280px) 100vw, 1280px\" \/><\/a> <a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2014\/01\/Image-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2722\" alt=\"Image 4\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2014\/01\/Image-4.png\" width=\"1280\" height=\"800\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-4.png 1280w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-4-300x187.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-4-1024x640.png 1024w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-4-150x93.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-4-400x250.png 400w, https:\/\/mohan.sg\/wp-content\/uploads\/2014\/01\/Image-4-900x562.png 900w\" sizes=\"(max-width: 1280px) 100vw, 1280px\" \/><\/a><\/div>\n<div><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Using wsadmin to enable an LDAP Federated Repository in WebSphere Application Server 8.5 <\/p>\n<p>This article is somewhat of an aide memoire for me, allow me to remember how to enable WebSphere Application Server to talk to an LDAP server, without needing to use a GUI \ud83d\ude42<\/p>\n<p> I pulled this together using my own WAS 8.5 [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2707"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2707"}],"version-history":[{"count":3,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2707\/revisions"}],"predecessor-version":[{"id":2723,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2707\/revisions\/2723"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}