Skip to content

Use GitHub App authentication for PublishMcrDocs command #1656

@lbussell

Description

@lbussell

The Microsoft GitHub org is restricting PAT lifetimes and will eventually require the usage of fine-grained PATs. Current guidance is to migrate all interactions with the Microsoft GitHub org to use a GitHub App by the end of FY25.
 

How to create the app

  • Create the app on personal github account
    • Permissions are defined at app creation time - this app probably just needs repo content write access
    • Record the App's Client ID somewhere - probably a pipeline variable group (it can be found on the App's management page)
  • Transfer ownership to the dotnet org
  • Add .NET containers team members as managers/admins of the App
  • Get the app installed on the microsoft org
  • Create a private key for the app and store it in our KeyVault
     

How to authenticate as an app

  1. Use the app's private key and Client ID to generate a JWT
  2. Exchange the JWT for an installation-specific token
  3. Use the token to authenticate to GitHub as the app

Step 1 is not handled by OctoKit or Dotnet.VersionTools.Automation. For step 2, we could add support for the installation token endpoint to VersionTools, or use OctoKit as a helper to exchange tokens. For step 3, we should be able to use the app installation token just like any other token with the VersionTools client. Migrating entirely to OctoKit is not necessary at this time.

Related

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions