cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1213
Views
2
Helpful
5
Replies

API call to validate the auth code hanging indefinitely (DUO Universal Prompt)?

qwmck
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

qwmck
Level 1
Level 1

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.

View solution in original post

5 Replies 5

qwmck
Level 1
Level 1

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?

qwmck
Level 1
Level 1

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.

DuoKristina
Cisco Employee
Cisco Employee

Thanks for coming back to share your solution.

Duo, not DUO.

Cervero
Level 1
Level 1

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;

jenrj
Cisco Employee
Cisco Employee

Hi @cerverojj, welcome back! Thanks so much for sharing your additional solution!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links