> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/new-experience/harness-platform-resources/connectors/artifact-repositories/connect-to-jenkins.md). Agents can also search and read this documentation through its [MCP server](https://developer.harness.io/~gitbook/mcp).

# Connect to Jenkins

Connect Harness to Jenkins using a Harness Jenkins Connector.

Continuous Integration (CI) can be performed in Harness using the CI module and [CI pipelines](https://developer.harness.io/continuous-integration/3.0/new-to-harness-ci/key-concepts.md).

If you are using Harness Continuous Delivery (CD) but not Harness Continuous Integration (CI), you can still perform CI using the **Jenkins** step in your CD Stage.

You can connect Harness to Jenkins using a Harness Jenkins Connector. This Connector allows you to Jenkins jobs in [Jenkins steps](https://developer.harness.io/continuous-delivery/use-continuous-delivery/cd-building-blocks/cd-steps/builds/run-jenkins-jobs-in-cd-pipelines.md).

This topic shows you how to add a Jenkins Connector to Harness.

#### Important note <a href="#important-note" id="important-note"></a>

Note the following authentication limitation before you connect:

* Harness does not support SAML authentication for Jenkins connections.

#### Review: Jenkins permissions <a href="#review-jenkins-permissions" id="review-jenkins-permissions"></a>

Make sure the user account for this connection has the following required permissions in the Jenkins Server.

* Overall: Read.
* Job: Build.

For token-based authentication, go to `http://JENKINS_IP_ADDRESS/jobs/me/configure` to check and change your API access token. The token is added as part of the HTTP header.

Go to [Jenkins Matrix-based security](https://wiki.jenkins.io/display/JENKINS/Matrix-based+security) to configure the permission matrix.

**Okta or Two-Factor Authentication**

If you use Okta or 2FA for connections to Jenkins, use **API Token** for **Authentication** in the Harness Jenkins Connector.

#### Step 1: Add a Jenkins connector <a href="#step-1-add-a-jenkins-connector" id="step-1-add-a-jenkins-connector"></a>

You can add a Jenkins Connector at the Project, Org, or Account level. This topic covers Projects. The process is the same for Org and Account.

You can also add the Jenkins Connector when setting up the Jenkins step. This topic covers adding it to the Project's Connectors.

Open a Harness Project.

In **Project Setup**, click **Connectors**.

Click **New Connector**, and then click **Jenkins**. The Jenkins Connector settings appear.

In **Name**, enter a name for this connection. You will use this name to select this connection in Jenkins steps.

Click **Continue**.

#### Step 2: Enter the Jenkins URL <a href="#step-2-enter-the-jenkins-url" id="step-2-enter-the-jenkins-url"></a>

Enter the URL of the Jenkins master or controller.

If you are using the Jenkins SaaS (cloud) edition, the URL is in your browser's location field.

If you are using the standalone edition of Jenkins, the URL is located in **Manage Jenkins**, **Jenkins Location**:

#### Step 3: Authentication <a href="#step-3-authentication" id="step-3-authentication"></a>

If you use Okta or 2FA for connections to Jenkins, use **API token** for **Authentication** in the Harness Jenkins Connector. Enter the credentials to authenticate with the server.

* **Username:** enter the user account username.
* **Password/API Token:** select/create a Harness Encrypted Text secret using the Jenkins API token or password.\
  For token-based authentication, go to `http://JENKINS_IP_ADDRESS/jobs/me/configure` to check and change your API access token. The token is added as part of the HTTP header.
* **Bearer Token (HTTP Header):** select/create a Harness Encrypted Text secret using the OpenShift OAuth Access Token in **Bearer Token (HTTP Header)**. The **Bearer Token (HTTP Header)** option is only for Jenkins servers hosted/embedded in an OpenShift cluster and using this authentication method. Go to [Authentication](https://docs.openshift.com/container-platform/3.7/architecture/additional_concepts/authentication.html) from OpenShift for details.

Click **Submit**.

The Jenkins Connector is added.

### Related concepts

Go to the following page to use the connector in a pipeline:

* [Run Jenkins Jobs in CD Pipelines](https://developer.harness.io/continuous-delivery/use-continuous-delivery/cd-building-blocks/cd-steps/builds/run-jenkins-jobs-in-cd-pipelines.md)

{% @harness-feedback/feedback %}
