You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Don't call HandleCodeRedemption twice in TokenAcquisition.cs#L125-L128Â #246
// As AcquireTokenByAuthorizationCodeAsync is asynchronous we want to tell ASP.NET core that we are handing the code
// even if it's not done yet, so that it does not concurrently call the Token endpoint. (otherwise there will be a
// race condition ending-up in an error from Azure AD telling "code already redeemed")
context.HandleCodeRedemption();
, verify that we still need to handle the code redemption twice. This should not be needed and is the sign smell like someone is using async void.
Why is it so?
We had many cases, in the past, where the code was redeemed twice (once by Microsoft.Identity.Web and once by ASP.NET Core), which is not allowed by Azure AD.
However, async should ensure that this works fine.
What to do?
If this bugs, then the bug needs to be fixed.
Activity
jennyf19 commentedon Jul 13, 2020
Included in 0.2.0-preview release