Back in v1 there was a bitbucket connector for dex. It was removed for v2. Neither is their a generic oauth2 connector that could be used with bitbucket.org, and I don't think the oidc connector can be used?
Is there is any current support and ideally an example for using bitbucket.org with dex?
I have Google working fine via the OIDC connector, and I assume, since this is no bitbucket-specific connector any more (was removed for dex v2), that OIDC would work for bitbucket.org?
Their OAuth2 information is here, is there OAuth2 implementation not sufficient for an OIDC flow?
This configuration below loads but them reports a 404 when connecting:
connectors:
# Bitbucket Settings -> 'OAuth' -> 'Add OAuth consumer', add callback URL
- type: oidc
id: bitbucket
name: Bitbucket
config:
issuer: https://bitbucket.org/site/oauth2/authorize
clientID: $BITBUCKET_KEY
clientSecret: $BITBUCKET_SECRET
redirectURI: https://dex.example.com/callback
Adding the application at the bitbucket.org end seems clear enough:

And if I visit this URL:
https://bitbucket.org/site/oauth2/authorize?client_id=$BITBUCKET_KEY&response_type=code
Then I get the screen you would expect:

If you authorize you get sent to the callback address with a code
https://dex.example.com/callback?code=abcedfg12345678
and I gather you swap that code for a token from https://bitbucket.org/site/oauth2/access_token via
$ curl -X POST -u "client_id:secret" \
https://bitbucket.org/site/oauth2/access_token \
-d grant_type=authorization_code -d code={code}
Can Dex support Bitbucket like this, or the custom connector needed again?
Hello @whereisaaron, did you make any progress on this?
Hi @ringods, no - no progress, as you see noone from the dex project replied. I don;t know why the v1 connector was not updated for v2.
It appears Atlassian supports OAuth 2 and flows similar to OIDC, but not real OIDC.
https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html
It is likely a modified OIDC dex connector could support it, e.g. here is support for Drupal support for Bitbucket.org from Drupal 7.
https://www.drupal.org/project/openid_connect_bitbucket
and for Jenkins:
https://wiki.jenkins.io/display/JENKINS/Bitbucket+OAuth+Plugin
Hello! I've submitted PR #1307 that creates a Bitbucket connector.
@edtan thanks again for this. @whereisaaron OK to close this issue?
Surely. Thanks @edtan... now just waiting for that sweet 2.12.0 release....
Most helpful comment
Hello! I've submitted PR #1307 that creates a Bitbucket connector.