Skip to content

Conversation

EinarGaustad
Copy link

@EinarGaustad EinarGaustad commented Aug 11, 2025

This pull request introduces support for authenticating with GitHub using a GitHub App, in addition to Personal Access Tokens (PAT), and updates the documentation and code accordingly.

Authentication enhancements:

  • Added a new New-GithubAppSession function in githound.ps1 to allow session creation via GitHub App credentials (client ID and private key), including JWT generation and access token retrieval.
  • Updated the documentation in README.md to describe both PAT and GitHub App authentication flows, including usage examples and parameter clarifications.

API request improvements:

  • Modified the Invoke-GithubRestMethod function in githound.ps1 to use the correct HTTP method ($Method) for paginated requests, instead of always using GET.

Testing

Run the following to obtain a valid session for a GitHub App: $session = New-GithubAppSession -OrganizationName <Name of your Organization> -ClientId (Get-Clipboard) -PrivateKeyPath <Path to Private Key Pem>

@jaredcatkinson
Copy link
Collaborator

Thank you for this! I will get testing and get back to you shortly!

@tr4l
Copy link

tr4l commented Aug 12, 2025

Very nice.
The app token is valid for one hour (if I'm correct).
Did you encounter issue on your scan?

@C0KERNEL C0KERNEL mentioned this pull request Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants