Skip to content

Commit

Permalink
add ephemeral key for dpop (#160)
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Bickerle <sebastian.bickerle@lissi.id>
  • Loading branch information
ntsbs authored Aug 16, 2024
1 parent 6ac70e0 commit 2a39cc9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ public interface IKeyStore
/// Asynchronously generates a key for the specified algorithm and returns the key identifier.
/// </summary>
/// <param name="alg">The algorithm for key generation (default is "ES256").</param>
/// <param name="isPermanent">If false creates an ephemeral key.</param>
/// <returns>A <see cref="Task{TResult}" /> representing the generated key's identifier as a string.</returns>
Task<KeyId> GenerateKey(string alg = "ES256");
Task<KeyId> GenerateKey(string alg = "ES256", bool isPermanent = true);

/// <summary>
/// Asynchronously loads a key by its identifier and returns it as a JSON Web Key (JWK) containing the public key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async Task<OneOf<OAuthToken, DPopToken>> RequestToken(
{
if (metadata.IsDPoPSupported)
{
var keyId = await _keyStore.GenerateKey();
var keyId = await _keyStore.GenerateKey(isPermanent: false);

var config = new DPopConfig(keyId, metadata.TokenEndpoint);

Expand Down

0 comments on commit 2a39cc9

Please sign in to comment.