Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Fix retrieval of dpop keys when using resources
Browse files Browse the repository at this point in the history
We don't have a per-resource dpop key, so we should not include the resource name when retrieving the dpop key.
  • Loading branch information
josephdecock committed Apr 18, 2024
1 parent 7da9e53 commit 085f90f
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ public async Task<UserToken> GetTokenAsync(

var tokenName = NamePrefixAndResourceSuffix(OpenIdConnectParameterNames.AccessToken, parameters);
var tokenTypeName = NamePrefixAndResourceSuffix(OpenIdConnectParameterNames.TokenType, parameters);
var dpopKeyName = NamePrefixAndResourceSuffix(DPoPKeyName, parameters);
var expiresName = NamePrefixAndResourceSuffix("expires_at", parameters);

// Note that we are not including the the resource suffix because there is no per-resource refresh token
// Note that we are not including the the resource suffix because
// there is no per-resource refresh token or dpop key
var refreshTokenName = NamePrefix(OpenIdConnectParameterNames.RefreshToken);
var dpopKeyName = NamePrefix(DPoPKeyName);

var appendChallengeScheme = AppendChallengeSchemeToTokenNames(parameters);

Expand Down Expand Up @@ -189,12 +190,12 @@ public async Task StoreTokenAsync(

var tokenName = NamePrefixAndResourceSuffix(OpenIdConnectParameterNames.AccessToken, parameters);
var tokenTypeName = NamePrefixAndResourceSuffix(OpenIdConnectParameterNames.TokenType, parameters);
var dpopKeyName = NamePrefixAndResourceSuffix(DPoPKeyName, parameters);
var expiresName = NamePrefixAndResourceSuffix("expires_at", parameters);

// Note that we are not including the resource suffix because there
// is no per-resource refresh token
// is no per-resource refresh token or dpop key
var refreshTokenName = NamePrefix(OpenIdConnectParameterNames.RefreshToken);
var dpopKeyName = NamePrefix(DPoPKeyName);

if (AppendChallengeSchemeToTokenNames(parameters))
{
Expand Down

0 comments on commit 085f90f

Please sign in to comment.