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 Apps Proof-of-Concept #69
base: main
Are you sure you want to change the base?
Conversation
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with |
FWIW, it's pretty easy to generate JWTs with Microsoft.IdentityModel.JsonWebTokens if you'd prefer to take a dependency on a more "official" library: using System.Security.Cryptography;
using Microsoft.IdentityModel.JsonWebTokens;
using Microsoft.IdentityModel.Tokens;
string CreateJsonWebToken(string clientId, string privateKey)
{
var rsa = RSA.Create();
rsa.ImportFromPem(privateKey);
var now = DateTimeOffset.Now;
var tokenDescriptor = new SecurityTokenDescriptor
{
Issuer = clientId,
IssuedAt = now.UtcDateTime,
NotBefore = now.UtcDateTime,
Expires = now.AddMinutes(10).UtcDateTime,
SigningCredentials = new(new RsaSecurityKey(rsa), SecurityAlgorithms.RsaSha256)
};
return new JsonWebTokenHandler().CreateToken(tokenDescriptor);
}
var token = CreateJsonWebToken("foo", "bar"); |
@MatisseHack Ooh, I should probably swap over. I used the library I did because I was going off of the Octokit docs 😬; perhaps we should change those as well? |
Good point! I've got nothing against |
- Nothing is working/fully-implemented - Some refactoring is still needed after implementation - Auth options error handling in the Build method need to go in their own helper - Middleware defaults still need to be loaded - App token creation and refresh still need to be implemented
…ow uses the more patform common package Microsoft.Identity..
This PR is the .NET side of octokit/go-sdk#69. It's a work in progress.
It's pending some discussion and decisions:
GitHubJwt
library?