Find plugins

Bitbucket OAuth0.5Minimum Jenkins requirement: 1.645ID: bitbucket-oauth

Installs: 2346
Last released: 2 years ago
No dependencies found

View Bitbucket OAuth Plugin on the plugin site for more information.

This Jenkins plugin enables OAuth authentication for Bitbucket users.


First you need to get consumer key/secret from Bitbucket.

  1. Log into your Bitbucket account.
  2. Click on your account avatar in the top right corner and select Bitbucket Settings.
  3. If your are a member of an organization, ensure you are on Team settings, not Account settings, from the drop down.
  4. Under ACCESS MANAGEMENT select OAuth.
  5. Under OAuth consumers, click Add consumer.
  6. The system requests the following information: Name is required. Others are optional.
  7. Press Add consumer. The system generates a key and a secret for you. Toggle the consumer name to see the generated Key and Secret value for your consumer.

Second, you need to configure your Jenkins.

  1. Open Jenkins Configure System page.
  2. Set correct URL to Jenkins URL.
  3. Click Save button.
  4. Open Jenkins Configure Global Security page.
  5. Check Enable security.
  6. Select Bitbucket OAuth Plugin in Security Realm.
  7. Input your Consumer Key to Client ID.
  8. Input your Consumer Secret to Client Secret.
  9. Click Save button.

Configure plugin via Groovy script

Either automatically upon Jenkins post-initialization or through Jenkins script console, example:

import hudson.security.AuthorizationStrategy
import hudson.security.SecurityRealm
import jenkins.model.Jenkins
import org.jenkinsci.plugins.BitbucketSecurityRealm

// parameters
def bitbucketSecurityRealmParameters = [
  clientID:     '012345678901234567',
  clientSecret: '012345678901234567012345678901'

// security realm configuration
SecurityRealm bitbucketSecurityRealm = new BitbucketSecurityRealm(

// authorization strategy - full control when logged in
AuthorizationStrategy authorizationStrategy = new hudson.security.FullControlOnceLoggedInAuthorizationStrategy()

// authorization strategy - set anonymous read to false

// get Jenkins instance
Jenkins jenkins = Jenkins.getInstance()

// add configurations to Jenkins

// save current Jenkins state to disk

Version History

Version 0.5 (5 Jun, 2016)

Version 0.4 (14 May, 2014)

Version 0.3 (31 Jul, 2013)

  • Works on reverse proxy environments ( Use Jenkins URL configuration instead of request URL )

Version 0.1 (29 May, 2013)

  • Initial release
ArchivesGet past versions