Jazz Authorization Server is based on the IBM WebSphere Liberty server. Because Jazz Authorization Server authenticates users, it must be configured with a user registry. WebSphere Liberty server has capabilities similar to the full WebSphere Application Server; it can be configured to use a Lightweight Directory Access Protocol (LDAP) registry, or users can be defined in local files.
This article will focus on steps to help configure JAS with a File based User Registry and LDAP User registry.
ELM
JAS
JazzAuthServer_install_dir/wlp/usr/servers/jazzop/defaults
folder one level up to JazzAuthServer_install_dir/wlp/usr/servers/jazzop/
server.xml
, appConfig.xml
, ldapUserRegistry.xml
and localUserRegistry.xml
appConfig.xml
- Contains Jazz Group/Role mappings and UserRegistry file information
ldapUserRegistry.xml
- Configuring Liberty with an LDAP user registry
localUserRegistry.xml
- Configuring Liberty file based registry
JazzAuthServer_install_dir/wlp/usr/servers/jazzop/localUserRegistry.xml
<server> <!-- Sample basic user registry definition The passwords for the "ADMIN" and "clmadmin" users are the same as the user names. If those users are to be retained, the wlp/bin/securityUtility script should be used to encode new passwords. Otherwise, new users should defined with encoded passwords. --> <basicRegistry> <user name="ADMIN" password="{xor}HhsSFhE="/> <user name="clmadmin" password="{xor}PDMyPjsyNjE="/> <user name="clmuser" password="plaintext_password"/> <group id="JazzAdmins" name="JazzAdmins"> <member name="ADMIN"/> <member name="clmadmin"/> </group> <group id="JazzUsers" name="JazzUsers"> <member name="clmuser"/> </group> <group id="JazzGuests" name="JazzGuests"> </group> <group id="JazzProjectAdmins" name="JazzProjectAdmins"> </group> </basicRegistry> <administrator-role> <user>clmadmin</user> </administrator-role> </server>
JazzAuthServer_install_dir/wlp/usr/servers/jazzop/appConfig.xml
file
<include location="localUserRegistry.xml" optional="true"/> <!--include location="ldapUserRegistry.xml" optional="true"/-->TO
<!--include location="localUserRegistry.xml" optional="true"/--> <include location="ldapUserRegistry.xml" optional="true"/>
JazzAuthServer_install_dir/wlp/usr/servers/jazzop/ldapUserRegistry.xml
and modify the ldapRegistry configuration for your LDAP registry
<server> <ldapRegistry ldapType="Microsoft Active Directory" baseDN="CN=Users,DC=test,DC=com" bindDN="CN=CLM Admin,CN=Users,DC=test,DC=com" bindPassword="********" host="ldapserver" id="ldapserver:389" ignoreCase="true" port="389" realm="ldapserver:389" recursiveSearch="true" sslEnabled="false"> <activedFilters userFilter="(&(sAMAccountName=%v)(objectcategory=user))" groupFilter="(&(cn=%v)(objectcategory=group))" userIdMap="user:sAMAccountName" groupIdMap="*:cn" groupMemberIdMap="memberOf:member" > </activedFilters> </ldapRegistry> </server>
<server> <ldapRegistry ldapType="IBM Tivoli Directory Server" baseDN="o=test.com" bindDN="uid=clmadmin,c=in,ou=Users,o=test.com" bindPassword="********" host="ldapserver" id="ldapserver:389" ignoreCase="true" port="389" realm="ldapserver:389" recursiveSearch="true" sslEnabled="false"> <idsFilters groupFilter="(&(cn=%v)(|(objectclass=groupOfUniqueNames)(objectclass=posixGroup)))" groupIdMap="*:cn" groupMemberIdMap="groupOfUniqueNames:uniquemember" userFilter="(&(uid=%v)(objectclass=person))" userIdMap="*:uid"> </idsFilters> </ldapRegistry> </server>
<server> <ldapRegistry ldapType="Custom" baseDN="dc=example,dc=com" host="localhost" id="localhostexample:10389" ignoreCase="true" port="10389" realm="localhostexample:10389" recursiveSearch="true" sslEnabled="false"> <customFilters groupFilter="(&(cn=%v)(|(objectclass=groupOfUniqueNames)(objectclass=posixGroup)))" groupIdMap="*:cn" groupMemberIdMap="groupOfUniqueNames:uniquemember" userFilter="(&(uid=%v)(objectclass=inetOrgPerson))" userIdMap="*:uid" > </customFilters> </ldapRegistry> </server>
Map Groups or Users as JAS Administrators who can perform JAS CLI operations, register Applications to JAS and access WebSphere Liberty AdminConsole JAS
<oauth-roles> <authenticated> <special-subject type="ALL_AUTHENTICATED_USERS" /> </authenticated> <clientManager> <group name="MYJazzAdmins" /> <group name="JazzAdmins"/> <user name = "clmadmin" /> </clientManager> </oauth-roles>
JazzAuthServer_install_dir/wlp/bin/securityUtility
$ securityUtility encode userPasswordwhere userPassword is the password to encode
When you first install JAS, it comes configured to use a local Derby database for storing information. It is not recommended to use Derby database for a production environment and note that Derby database won't work in a clustered JAS environment, since that information won't be available to all the instances.
The basic steps to configure the database are:
The following links provide information for both Oracle and DB2, and sample SQL scripts are available that can create the necessary tables. But note that you will need to customize these scripts for your own environment.
The JAS database is used to store client registration information (i.e. all the applications that are configured to use the JAS for authentication) and information about authentication tokens that have been issued to clients. The client registration information is small and static, so it takes very little space in the database, but the token information is dynamic, and the space that it uses is proportional to the number of times a client will authenticate with a CLM application. Also, tokens have expiration periods; token information is retained until it expires. Therefore, an environment in which there are many authentications taking place and in which token expiration times are fairly long will require more storage space in the database.
Also, the JAS will load all unexpired tokens for a particular user into memory. If there are many tokens outstanding for a single user, more Java heap memory may be required than in the default configuration. In particular, since RTC build engines are usually configured to authenticate as a single designated "build" user, lots of build activity may result in the need to increase the Java heap size for the JAS.
Database storage size can be reduced by shortening the token expiration periods. There are two of them, one for access tokens and one for refresh tokens. The default access token expiration time is 6 hours, so it generally won't cause a problem. But the default refresh token time is 7 days, which can cause them to accumulate quite a bit. To reduce that expiration time, adjust the value for the "authorizationGrantLifetime" attribute of the <oauthProvider> element in the JazzAuthServer_install_dir/wlp/usr/servers/jazzop/appConfig.xml
file. The default configuration is
<oauthProvider id="JazzOP" httpsRequired="true" autoAuthorize="true" customLoginURL="/jazzop/form/login" accessTokenLifetime="7201" authorizationGrantLifetime="604801"> <autoAuthorizeClient>client01</autoAuthorizeClient> <databaseStore dataSourceRef="OAuthFvtDataSource" /> </oauthProvider>
The value "604801" is 7 days plus 1 second, in seconds. It can be reduced to make refresh tokens expire quicker and therefore not accumulate as much in the database.
For more information, see work item 471597
The default JVM heap allocated to a WebSphere Liberty server is 60MB. This applies to JAS as well and to increase the Java heap size, you can create jvm.options file under JazzAuthServer_install_dir/wlp/usr/servers/jazzop/jvm.options
and include the JVM memory parameters, one per line. For example, these entries will increase the heap size to 2GB:
-Xms2G -Xmx2G
For more information see Manually Customizing Liberty Environment
$ cd JazzAuthServer_install_dir $ ./start-jazz
{"data":[]}
User to Role Mappings
Ensure pop-up blocker is disabled on the browser, or Pop-ups are allowed for ELM and JAS URLs. Here are instructions to configure JTS with LDAP User Registery
User Groups to Jazz Roles mappings (JazzAdmins, JazzUsers etc) are picked from JTS configuration when JAS is configured with LDAP. When Users accesses an ELM application URL, they are redirected to JAS for Authentication. Post successful authentication JTS performs the ldapsearch Query to fetch groups with LDAP details mentioned under
JTS > Advanced Properties > com.ibm.team.repository.service.jts.internal.userregistry.ldap.LDAPUserRegistryProvider for User group to Jazz role mappings.
Note: We can only map direct LDAP groups in JTS. Special Subjects like ALL_AUTHENTICATED_USERS or NESTED_GROUPS would not work with JAS based deployments
Here is an extract from JTS logs with debug enabled, where it is mapping to the Jazz Groups configured in JTS.
DEBUG m.repository.servlet.internal.oidc.OidcAuthHandler [TID: 37404299] - Using group-to-role mapping "{cn=MYJazzAdmins,CN=Groups,DC=clm,DC=com:[JazzAdmins],cn=MYJazzGuests,CN=Groups,DC=clm,DC=com:[JazzGuests],cn=MYJazzProjectAdmins,CN=Groups,DC=clm,DC=com:[JazzProjectAdmins],cn=MYJazzUsers,CN=Groups,DC=clm,DC=com=com:[JazzUsers]}" for 300000 ms /jts/service/com.ibm.team.repository.service.internal.IExternalUserRegistryRestService/externalUserRegistryConfiguration] DEBUG ce.jts.internal.userregistry.ldap.LDAPUserRegistry [TID: 7FEA9AFC] - Query to fetch group full names - ldapsearch -h ldap://ldapserver:389 -b "CN=Groups,DC=clm,DC=com" "(| (cn=MYJazzAdmins)(cn=MYJazzGuests)(cn=MYJazzProjectAdmins)(cn=MYJazzUsers))"
For new installations, during JTS/Setup select the User registry type as LDAP and configure to the same LDAP registry that is configured with JAS and enter the group mappings under the property Jazz to LDAP Group Mapping
Status icon key: