Skip to content

Conversation

@keegan-caruso
Copy link
Contributor

Description

JsonWebTokenHandler would only return unwrapped keys if there was no errors. This change is to align with the behavior in JwtSecurityTokenHandler, that is it returns the keys that were able to be unwrapped, and only throw if no keys were able to be unwrapped.

Relates to #2695

JsonWebTokenHandler would only return unwrapped keys if there was no errors.
This change is to align with the behavior in JwtSecurityTokenHandler, that is
it returns the keys that were able to be unwrapped, and only throw if no keys
were able to be unwrapped.

Relates to #2695
@keegan-caruso keegan-caruso requested a review from a team as a code owner September 5, 2024 20:54
@sruke
Copy link
Contributor

sruke commented Sep 5, 2024

Should the logic here in JsonWebTokenHandler.DecryptToken be updated as well?

@keegan-caruso
Copy link
Contributor Author

Should the logic here in JsonWebTokenHandler.DecryptToken be updated as well?

Yeah, good idea. done.

Copy link
Contributor

@iNinja iNinja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comment, otherwise looks good.

@keegan-caruso keegan-caruso merged commit ad4ec65 into dev Sep 9, 2024
@keegan-caruso keegan-caruso deleted the kecaruso/fix-keywrap-error branch September 9, 2024 18:07
}

if (unwrappedKeys.Count > 0 && exceptionStrings is null)
if (unwrappedKeys.Count > 0 || exceptionStrings is null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we care about exceptionStrings if we have found any possible keys?

}

if (unwrappedKeys.Count > 0 && exceptionStrings is null)
if (unwrappedKeys.Count > 0 || exceptionStrings is null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we care about exceptionStrings if we have some keys?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants