Skip to content
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

[Bug] Don't call HandleCodeRedemption twice in TokenAcquisition.cs#L125-L128 #246

Closed
jmprieur opened this issue Jun 24, 2020 · 1 comment

Comments

@jmprieur
Copy link
Collaborator

Which Version of Microsoft Identity Web are you using ?
Microsoft Identity Web 0.1.5-preview

**Where is the issue?

*In

// 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.

@jennyf19
Copy link
Collaborator

Included in 0.2.0-preview release

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

No branches or pull requests

2 participants