-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
Update AttestationVerifier api to Async #458
Conversation
Span<byte> appIdHash = stackalloc byte[32]; | ||
SHA256.HashData(appId, appIdHash); | ||
if (!appIdHash.SequenceEqual(request.AuthData.RpIdHash)) | ||
byte[] appIdHash = SHA256.HashData(appId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure to understand this change. Why not continue to hash into a stackalloc byte[32]
directly instead of allocating a byte array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref structs (including Spans) aren't allowed inside of an async block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I'm not familiar, could help explain to me why our methods would need to be made async? |
Hey @abergs The new Microsoft.IdendityModel.JsonWebTokens obsoleted the synchronous API used to validate JSON web tokens, and replaced it with an async API Here's the new method we'll need to use to swap out the library . The main benefits of switching to the new library are:
|
Thanks for explaining @iamcarbon, I didn't catch that this was related to our calls to Everything looks good, just some conflicts to resolve. |
@abergs Resolved. |
In preparation to utilize the preferred Microsoft.IdendityModel.JsonWebTokens async API, this PR updates the methods that will need to also be made async.
This PR contains the following changes: