-
Notifications
You must be signed in to change notification settings - Fork 32
Duo-Web-v2.js fails when embedding document has really long url #4
Comments
Hey @dacurry-tns! For compatibility with older browsers, it is (unfortunately) mandatory for us to supply the full URL as the Thanks for raising this issue! |
Thanks for the quick answer. If I'm understanding what you're saying, the If that's the case, then wouldn't it be possible to simply test for that and act accordingly? Something like this:
|
Hello, I have to create a two-factor authentication in C # (asp.net) with duo as part of a business project but I'm still neophyte in C #. I would like to make a sign_request call from my aspx page before the Duo.init with IFRAME (examples are given here: https://duo.com/docs/duoweb but they are only in python), I did a lot of research on the internet on this topic without finding an answer ! You can help me ? I'm struggling ! Thank you in advance ! |
Closing this issue out since it's been a few years. Duo has released new clients for our updated Universal Prompt flow, which should avoid this problem, since it no longer relies on an iframe. See https://duo.com/docs/universal-prompt-update-guide for more information on the Universal Prompt. We have new clients for the new prompt available on Github See duosecurity/duo_python#57 for an example migration of a Python web application. The overall process will be similar for other languages. |
Note: The information below was originally submitted as Duo Support ticket 00246800. On May 8, "Hiten" from Duo informed me that this had been submitted to development as a feature request rather than a problem report (not sure why), and that it therefore "may not get an instant response." He suggested raising the issue here as well, and hence this post.
We are using Duo with the Apereo CAS server (v5.2.4), which uses the Duo Web SDK to display the Duo prompt. In general, this works just fine. However, in some circumstances, as a result of the way that CAS and Spring webflows work, the URL of the page that embeds the Duo Web SDK JavaScript (Duo-Web-v2.js) and
<iframe>
can end up being very--several hundred or even several thousand characters--long, like this:The Duo Web SDK JavaScript uses this entire value (
document.location.href
) when it builds the Duo-hosted URL that the<iframe>
is supposed to load its content from (thesrc
attribute):Unfortunately, this can the result in a URL that is too long to work with Internet Explorer, which has a maximum URL length of 2,083 characters. This causes the Duo prompt (the contents of the
<iframe>
) to simply fail to appear, with no error message of any kind and no alternative way for the user to complete the Duo authentication, short of using a different browser and starting over. Microsoft's Edge browser fails in a similar way (even though it supposedly has a much longer maximum URL length).And, at least a couple of times now, the resulting URL has even, apparently, been so long that Duo's back end doesn't like it:
Although the super-long URL of the embedding page is not the Duo Web SDK's fault, a simple one-line change to Duo-Web-v2.js would enable the code to work correctly in this situation:
The change simply strips the query parameters from the embedding page's URL (which would have no meaning to the Duo server anyway) before passing it onto the
<iframe>
src
attribute (and thus the Duo back end).We have tested this change across several different CAS-enabled services and several different browsers, and it seems to both fix the problem and not cause any other issues that we can see. (We recognize that this doesn't represent "complete" testing, but it's what we're able to do.)
I'm happy to submit a pull request for this if you prefer.
The text was updated successfully, but these errors were encountered: