How to do a javascript redirection to a ClickOnce deployment URL?
Posted
by jerem
on Stack Overflow
See other posts from Stack Overflow
or by jerem
Published on 2010-03-30T09:54:23Z
Indexed on
2010/03/30
11:43 UTC
Read the original article
Hit count: 346
I have a ClickOnce application used to view some documents on a website. When connected, the user sees a list of documents as links to http://server/myapp.application?document=docname.
It worked fine until I had to integrate the website authentication/security system into my application.
The website uses a ticketing system to grant access to its users. A ticket is generated by a web application and needs to be added to the deployment URL querystring, then I have to check at application startup that the ticket given in querystring was right by making another request to the web application. So the deployment URL becomes something like: h ttp://server/myapp.application?document=docname&ticket=ticketnumber.
The problem is the ticket is valid only 10 seconds, so I have to get it only after the user has clicked a link. My first try was to have some javascript do the request to get the ticket, generate the proper deployment URL and then redirect the user to this URL with "window.location = deploymentUrl;".
It works fine in Firefox, but IE does not prompt the user for installation. I guess it is a ClickOnce security constraints, but I am able to do the redirection when doing it on localhost, so I hope there is a workaround. I have also added the server on the "trusted sites" list in IE options.
Is it possible to have that working in IE? What are my other options to do that?
© Stack Overflow or respective owner