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

github app: generate jwt with powershell #30679

Merged
merged 6 commits into from
Dec 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
  • Loading branch information
skedwards88 authored Dec 19, 2023
commit 37d9a0f91177ef143080e2d52aa05302ea8cdea9
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,13 @@ printf '%s\n' "JWT: $JWT"

### Example: Using PowerShell to generate a JWT

skedwards88 marked this conversation as resolved.
Show resolved Hide resolved
In the following example, replace `YOUR_PATH_TO_PEM` with the file path where your private key is stored. Replace `YOUR_APP_ID` with the ID of your app. Make sure to enclose the values for `YOUR_PATH_TO_PEM` in double quotes.

```ps1 copy
skedwards88 marked this conversation as resolved.
Show resolved Hide resolved
#!/usr/bin/env pwsh

$app_id = 123456
$private_key_path = "my-awesome-app.2023-12-14.private-key.pem"
$app_id = YOUR_APP_ID
$private_key_path = "YOUR_PATH_TO_PEM"

$header = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((ConvertTo-Json -InputObject @{
alg = "RS256"
Expand Down
Loading