-
Notifications
You must be signed in to change notification settings - Fork 356
add OAuth authentication #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'm not sure how to deal with real username/password after that
Thanks for picking up the effort :) |
@Casz Any idea on whom could help me / give me some pointer on how to support both OAuth and user/password credentials ? |
Check if the provided credential match a valid Bitbucket OAuth key/secret
I made a test case for the OAuth authenticator but it requires an access to bitbucket.org and to generate a OAuth key/secret so I didn't include it in the PR |
I'd appreciate if you could avoid force pushing 😓 |
Sure. Any idea why the integration failed on jenkins ? |
@kurddt I'd guess ci.jenkins.io is having a bad day :) |
@Casz Is there any way to re-start it ? |
...com/cloudbees/jenkins/plugins/bitbucket/api/credentials/BitbucketOAuthCredentialMatcher.java
Outdated
Show resolved
Hide resolved
...com/cloudbees/jenkins/plugins/bitbucket/api/credentials/BitbucketOAuthCredentialMatcher.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java
Show resolved
Hide resolved
Co-Authored-By: Joseph Petersen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM one nit pick
Problem atm is both Oauth and username password uses the same base class |
I would love some documentation on how to set this up. |
I could write a small documentation, about the usage of this feature just tell me in which format and/or where you want want it. Concerning, the base class. Even if they use the same base class, the class can detect if the credentials match a API key and secret. The other solution would be to introduce an other type of credentials in Jenkins but I had no idea how to do so. |
We have section for that on the user guide: https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/docs/USER_GUIDE.adoc |
link to see current commit author: https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/262/commits/13ca375e745844106dba199de36ac202b9959d9f.patch @kurddt Or look into fixing your git user.email config 😅 to get proper credit for your commits 🏆 |
@Casz Thanks, I made a new clone of the repo but forgot to change the local git config 😅 |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
It would be awesome to have this functionality supported, did this go stale? |
hopefully #299 should remove the blocker |
|
||
public class BitbucketOAuthAuthenticator extends BitbucketAuthenticator { | ||
|
||
private Token token; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a good idea to cache the token, I assume it has a validity time 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can move forward without caching. Perhaps a future PR.
Your checklist for this pull request
I tried to revive #69 by re-basing on master and adapting the code to the changes that was made since especially #101 .
The functionality is working, but the normal user/password is broken. I don't really have any idea how to make both work so any suggestion would be greatly appreciated