Integrating Crowd with Atlassian Jira

Currently Crowd supports centralized authentication and single sign-on for Jira versions 3.7.4 and later.

Please check that this documentation applies to your version of Crowd

Please check the Crowd release number in this documentation against your version of Crowd. If you are using a different version of Crowd, you can find the appropriate documentation under 'Previous Versions' on the Crowd documentation homepage.

On this page:

Compatibility of Jira and Crowd Versions

Please ensure that your Crowd and Jira versions are compatible:

  • If you are using Jira 4.2 please upgrade to Crowd 2.0.7 or later. (watch out for Crowd 2.4 though:  JRA-27890 - Getting issue details... STATUS )
  • If you are using Jira 4.3 or later, please upgrade to Crowd 2.1 or later.
    Explanation: With Jira 4.3 and higher, the communication between Jira and Crowd has been changed from SOAP to REST.

Prerequisites

Do not deploy multiple Atlassian applications in a single Tomcat container.

Deploying multiple Atlassian applications in a single Tomcat container is not supported. We do not test this configuration and upgrading any of the applications (even for point releases) is likely to break it. There are also a number of known issues with this configuration. See this FAQ for more information.

There are also a number of practical reasons why we do not support deploying multiple Atlassian applications in a single Tomcat container. Firstly, you must shut down Tomcat to upgrade any application and secondly, if one application crashes, the other applications running in that Tomcat container will be inaccessible.

Finally, we recommend not deploying any other applications to the same Tomcat container that runs Crowd, especially if these other applications have large memory requirements or require additional libraries in Tomcat's lib subdirectory.

  1. Download and install Crowd. Refer to the Crowd installation guide for instructions. We will refer to the Crowd root folder as CROWD.
  2. Download and install Jira (version 3.7.4 or later). Refer to the Jira installation guide for instructions. We will refer to the Jira root folder as JIRA. For the purposes of this document, we will assume that you have used the 'Crowd distribution (not EAR-WAR)' (i.e. the easier and recommended) installation method of Jira. If you need to install Jira as an EAR/WAR, simply explode the EAR/WAR and make the necessary changes as described below, then repackage the EAR/WAR.
  3. Run the Jira Setup Wizard, as described in the Jira installation guide. During this setup process, you will define the JIRA administrator's username and password. It is easier to do this before you integrate Jira with Crowd.
  4. For Jira 4.2 or earlier: after setting up Jira, shut down Jira before you begin the integration process described below.

If you are using Jira as a User Directory in any other applications such as Fisheye or Confluence these will be inaccessible while Jira is shut down. You can avoid this by configuring these applications to use Crowd prior to integrating Crowd with Jira.


Step 1. Configuring Crowd to talk to Jira

1.1 Prepare Crowd's Directories/Groups/Users for Jira

  1. The Jira application will need to locate users from a directory configured in Crowd. You will need to set up a directory in Crowd for Jira. This directory may be any Crowd-configured directory, such as an LDAP directory hooked up to Crowd or a Crowd internal directory. For information on how to do this, see Adding a Directory.

    We will assume that the directory is called Jira Directory in Crowd for the rest of this document. It is possible to assign more than one directory for an application, but for the purposes of this example, we will use Jira Directory in Crowd to house Jira users.
  2. Jira also requires particular groups to exist in the directory in order to authenticate users. You need to ensure that these three groups exist in the Jira Directory in Crowd:
    • jira-users
    • jira-developers
    • jira-administrators
  3. You also need to ensure that the Jira Directory in Crowd contains at least one user who is a member of all three groups. You can either:
    • If you have an existing Jira deployment and would like to import existing groups and users into Crowd, use the Jira Importer tool by navigating to Users > Import Users > Atlassian Importer. Select 'Jira' as the Atlassian Product and the Jira Directory in Crowd as the directory into which Jira users will be imported. For details please see Importing Users from Atlassian Jira. (info) If you are going to import users into Crowd, you need to do this now before you proceed any further.
      OR:
    • If you don't wish to import your Jira users, use the Crowd Administration Console to create the three groups, then create at least one user in the Jira Directory in Crowd and add them to the three Jira-specific groups (above). The Crowd documentation has more information on creating groupscreating users and assigning users to groups.

Error will occur in JIRA if the required groups do not exist

JIRA expects that the group names mentioned above will exist. If you need to use different group names, you may want to remove the above pre-existing groups from Jira's Global Permissions. If the above groups do not exist somewhere in Crowd, you will receive an error when you try to remove the groups from Jira's Global Permissions.

1.2 Define the Jira Application in Crowd

If multiple versions of Jira are being connected to Crowd, ensure you define an application in Crowd for each one

Crowd needs to be aware that the Jira application will be making authentication requests to Crowd. We need to add the Jira application to Crowd and map it to the Jira Directory in Crowd.

  1. Log in to the Crowd Administration Console and navigate to Applications > Add Application.
  2. Complete the 'Add Application' wizard for the Jira application. See the instructions. (info) The Name and Password values you specify in the 'Add Application' wizard must match the application.name and application.password that you will set in the JIRA/atlassian-jira/WEB-INF/classes/crowd.properties file. (See Step 2 below.)

1.3 Specify which users can log in to Jira

Once Crowd is aware of the Jira application, Crowd needs to know which users can authenticate (log in) to Jira via Crowd. As part of the 'Add Application' wizard, you will set up your directories and group authorizations for the application. If necessary, you can adjust these settings after completing the wizard. Below are some examples.

You can either allow entire directories to authenticate, or just particular groups within the directories. In our example, we will allow the jira-users, jira-developers and jira-administrators groups within the Jira Directory in Crowd to authenticate:


(info) With this example, only users who are members of the jira-users, jira-developers and jira-administrators groups will be able to authenticate against Jira.

For details please see Specifying which Groups can access an Application.

1.4 Specify the address from which Jira can log in to Crowd

As part of the 'Add Application' wizard, you will set up Jira's IP address. This is the address which Jira will use to authenticate to Crowd. If necessary you can add a hostname, in addition to the IP address, after completing the wizard. See Specifying an Application's Address or Hostname.

Step 2. Configuring Jira to talk to Crowd

The instructions for step 2 below apply to Jira 4.3 or newer. If you use Jira 4.2 or older, please follow "Step 2" on Integrating Crowd with Atlassian Jira 4.2 or earlier instead.

2.1 Add a Crowd Directory in Jira

Jira can use Crowd for user authentication simply by adding 'Atlassian Crowd' as user directory.

  1. Login to the administration section of Jira
  2. Click on the 'User Directories' label of the left bar under the 'User management'. tab.
  3. Click 'Add Directory'. Then select 'Atlassian Crowd' from the dropdown list. Click 'Next'.
  4. Enter connection parameters and save. If you configure Server URL to use HTTPS, by replacing http:// with https://, communications between Jira and Crowd will be encrypted.
  5. Now a new Crowd directory should appear on the user directory list.

For more information on configuring a Crowd directory in Jira, check out the Jira documentation on Connecting to Crowd or Another Jira Server for User Management.

2.2 Configure Jira to use Crowd's Authenticator to enable SSO (Optional)

At this stage, Jira is set up for centralized authentication. If you wish, you can now enable single sign-on (SSO) to Jira. This will ensure that Jira's authentication and access request calls will be performed using Seraph.

Note: if you are migrating/upgrading a Jira instance that already uses Crowd, you will need to merge these files (not overwrite them).

  1. If Jira is running, shut it down first.
  2. Edit the JIRA/atlassian-jira/WEB-INF/classes/seraph-config.xml file. Comment out the authenticator node:

    <!--<authenticator class="com.atlassian.jira.security.login.JiraSeraphAuthenticator"/>-->
    


    Uncomment the line that contains the new authenticator:

    <authenticator class="com.atlassian.jira.security.login.SSOSeraphAuthenticator"/>
    
  3. Copy the crowd.properties file from CROWD/client/conf/ to JIRA/atlassian-jira/WEB-INF/classes.
  4. Edit JIRA/atlassian-jira/WEB-INF/classes/crowd.properties. Change the following properties:

    Key

    Value

    application.name

    jira
    The application name must match the name that you specified when you defined the application in Crowd (see Step 1 above).

    application.password

    The password must match the one that you specified when you defined the application in Crowd (see Step 1 above).

    crowd.base.url

    eg. (http://localhost:8095/crowd/)
    If your Crowd server's port is configured differently from the default (i.e. 8095), set it accordingly.

    crowd.base.url must be the same URL used to access Crowd in your Browser.

    session.validationinterval

    Set to 0, if you want authentication checks to occur on each request. Otherwise set to the number of minutes between request to validate if the user is logged in or out of the Crowd SSO server. Setting this value to 1 or higher will increase the performance of Crowd's integration.

It is possible to define multiple user directories in Jira. However, if you enable SSO integration, you will only be able to authenticate as users from the Crowd server defined in the crowd.properties file.

You can read more about optional settings in the crowd.properties file.

2.3 (Optional) Disable the Auto-Complete Function in Jira's User Picker

To improve performance on page-loading in Jira, we recommend that you disable the auto-complete function in Jira's 'User Picker' popup screens. 

More information: In our experience, disabling this feature in Jira helps performance for customers with extremely large user bases. If you leave this feature enabled and have adequate performance results in Jira, feel free to leave it enabled.

See Crowd in Action

  • You should now be able to login using users belonging to the jira-users group. Try adding a user to the group using Crowd — you should be able to login to Jira using this newly created user. That's centralized authentication in action!
  • If you have enabled SSO, you can try adding the JIRA Directory in Crowd and jira-administrators group to the crowd application (see Mapping a Directory to an Application and Specifying which Groups can access an Application). This will allow Jira administrators to log in to the Crowd Administration Console. Try logging in to Crowd as a Jira administrator, and then point your browser at Jira. You should be logged in as the same user in Jira. That's single sign-on in action!

Known Limitations

If you are using Jira 4.2, a problem occurs in Jira if a user is removed after that user has participated in an issue i.e. if Jira refers to the user. If the user is internally managed by Jira, Jira will prevent the removal of the user but if the user is managed by an external system such as Crowd, Jira will throw a DataAccessException. We recommend upgrading Jira or deactivating the user's account by removing them from the jira-users group.

If you are using Jira 4.3 or later, this problem has been resolved, allowing the removal of users that are externally managed, despite existing data associations. When a user managed by an external system such as Crowd is removed, any user associations in Jira will continue to be associated, with the username acting as a placeholder. This username will not be listed in the User Browser and no profile exists for that user. 

Last modified on Apr 15, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.