06-14-2022 02:31 PM
Hi, we’ve implemented DUO Universal Prompt in a .Net web app using the .Net DuoUniversal library 1.1.3 published on Nuget.
The whole back and forth works great. However, in the very last step where we attempt to exchange the authorization code it just hangs indefinitely.
We don’t need async so we’re just calling as such:
idToken = duoClient.ExchangeAuthorizationCodeFor2faResult(code, username).Result
Stepping though the code… once we reach that line above it will just disappear in there and never come back.
Watching the traffic w/ Fiddler (https-decrypting proxy) I see the https tunnel gets setup… but I don’t see any additional traffic taking place.
Any ideas?
I’ve yet to attempt to look through the document on how to make the call outside the library. Guessing there is a rest, etc. call supposed to be happening behind the scenes. I’ll probably look at that as well but it would be great if the library just worked.
Thanks for any thoughts.
-Mike
Solved! Go to Solution.
06-15-2022 06:58 AM
Ok, following up.
The issue was on our side. Apparently using the .Result() as a cheat to call the async method from a non-async method was causing a repeatable deadlock.
We wound up just making the chain of calls async all the way through and everything is working great.
06-14-2022 03:16 PM
So, I grabbed a copy of the library from git hub so I could step through the code.
In the screenshots below you can see I’ve followed the duoClient.ExchangeAuthorizationCodeFor2faResult() call all the way into a DoPost() method.
Looks like a standard post to me… and it just hangs on the line highlighted in yellow… it just never comes back. So odd.
Any ideas?
06-15-2022 06:58 AM
Ok, following up.
The issue was on our side. Apparently using the .Result() as a cheat to call the async method from a non-async method was causing a repeatable deadlock.
We wound up just making the chain of calls async all the way through and everything is working great.
06-16-2022 07:18 AM
Thanks for coming back to share your solution.
08-02-2022 10:22 AM
I found a different solution that doesn’t require changing the entire stack to async calls. In our case we couldn’t do so because then you can’t access session data.
var token = Task.Run(async () =>
{
return await duoClient.ExchangeAuthorizationCodeFor2faResult(context.Request["code"], username);
}).Result;
08-03-2022 06:29 AM
Hi @cerverojj, welcome back! Thanks so much for sharing your additional solution!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide