-
Notifications
You must be signed in to change notification settings - Fork 733
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
GitHub app: isCredentialValid doesn't work #582
Comments
Hi @timja Both points have been discussed on #570. I really suggest you read it (I know it's bit lengthy, but that's going to answer most questions you may have)
The
This was also discussed on #570 and I proposed to @bitwiseman that a convenience/cosmetic method was created to make it easier for developers to know how to make heads or tails of the multiple ways of authenticating to GIthub with this library. Basically, the summarised version of why you are facing it would be:
How to address it: Before the #583 PR is approved: GitHub githubAuthAsInst = new GitHubBuilder()
.withOAuthToken(appInstallationToken.getToken(), "")
.build(); After the #583 PR is approved: GitHub githubAuthAsInst = new GitHubBuilder()
.withAppInstallationToken(appInstallationToken.getToken())
.build(); Hope this helps |
@PauloMigAlmeida thanks for the reply I have read it I can authenticate fine there's no issue with that. What doesn't work is some of the validation that's being done by the UI and some background processes. i.e. the UI tries to check a credential is valid, and the method |
@timja I see. Help me understand this
My brain must not be working today :( That doesn't sound like it's associated with this sdk but with some Jenkins plugin mechanism. Am I right? Or am I missing something? |
I should have linked to it sorry: |
Hmmm got it now. Thanks for the link. I see what you are trying to do but the TBH, the The closest you can get to it (for now) authenticated as a Github App (whether via JWT or App Installation Token) would be to implement in your source code the same try/catch mechanism used on @bitwiseman let me pick your brains on this one. Do you think we should make |
Hm, maybe we want to add a |
@bitwiseman that sounds a good idea. I will implement it in the next few days and open a PR. @timja anything else you experienced that is blocking you from progressing on what you are doing? |
not anymore, thanks |
I'm trying to add GitHub app support to the github-branch-source Jenkins plugin,
I'm facing 2 main issues,
From the GitHub class I can't tell if I'm using a GitHub app
isCredentialValid / getMyself don't work
Ideally
isCredentialValid
would do something else when using aGitHub
app and not sure if there's anything that can be done aboutgetMyself
cc @PauloMigAlmeida
The text was updated successfully, but these errors were encountered: