Skip to content
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

Add support for authentication with JWT #405

Open
ChristopherCapito opened this issue Apr 19, 2023 · 2 comments
Open

Add support for authentication with JWT #405

ChristopherCapito opened this issue Apr 19, 2023 · 2 comments
Labels
api completeness This is basic API functionality that hasn't been implemented yet. help wanted Anyone in the community is welcome to do this work up for grabs Anyone in the community is welcome to do this work

Comments

@ChristopherCapito
Copy link

A description of your problem or question

Greetings

First of all: Great job getting portion of the API working. I just encountered an issue today where this could have been helpful. Although I wonder how this pans out for large-scale automations where the token limit of 5000 will be hit (just had such a case today).

Is it possible to also use a GitHub App AccessToken? I know that in order to get that we need a signed JWT, but that could be accomplished with PowerShell I think, provided we provide a certificate.

Alternatively, is it possible to provide my own Bearer Token?

@ChristopherCapito ChristopherCapito added support User support questions triage needed An issue that needs to be reviewed by a member of the team. labels Apr 19, 2023
@HowardWolosky HowardWolosky added up for grabs Anyone in the community is welcome to do this work api completeness This is basic API functionality that hasn't been implemented yet. help wanted Anyone in the community is welcome to do this work and removed support User support questions triage needed An issue that needs to be reviewed by a member of the team. labels Apr 20, 2023
@HowardWolosky HowardWolosky changed the title Can this be used with a GitHub App Token? Add support for authentication with JWT Apr 20, 2023
@HowardWolosky
Copy link
Member

Is it possible to also use a GitHub App AccessToken? I know that in order to get that we need a signed JWT, but that could be accomplished with PowerShell I think, provided we provide a certificate.

This project doesn't currently support that, but I'm totally open to submissions to add that support.

Alternatively, is it possible to provide my own Bearer Token?

At the moment, no.
Here you can see how we compose the Authorization header:

$AccessToken = Get-AccessToken -AccessToken $AccessToken
if (-not [String]::IsNullOrEmpty($AccessToken))
{
$headers['Authorization'] = "token $AccessToken"
}

This uses the token syntax as opposed to the Bearer syntax (which a JWT would require).

@ChristopherCapito
Copy link
Author

Understood. Yeah I noticed some functionality I would need is missing from the API implementation as well. I ll see what I can contribute once I have finished my work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api completeness This is basic API functionality that hasn't been implemented yet. help wanted Anyone in the community is welcome to do this work up for grabs Anyone in the community is welcome to do this work
Projects
None yet
Development

No branches or pull requests

2 participants