bermanbp
06-30-2010, 06:51 PM
Hi All,
I am currently going back to an older asp.net 2.0 site that runs in IIS 6.0. The client asked that I protect their static file assests (PDFs, DOCs, etc) with the same forms authentication used to protect the pages on the site.
I was able to implement fairly easily using a wildcard mapping within IIS that routes everything through asp.net's dll. I am only having one more small issue that I was hoping someone might have a solution for.
When a user attempts to access the resource and is not logged in they will be redirected to login.aspx. For example, if the uses attempts to access http://www.mywebsite.com/files/document1.doc, she will be redirected to http://www.mywebsite.com/login.aspx?returnUrl=/files/document1.doc . Once the user enters her credentials the file begins to download or load. Depending on how the user's browser is configured, the user is not directed away from the login page, even though they successfully authenticated. If the user clicks the login button again, out of confusion, the file downloads again. Is there a way to redirect the user after login without affecting the download?
I am currently going back to an older asp.net 2.0 site that runs in IIS 6.0. The client asked that I protect their static file assests (PDFs, DOCs, etc) with the same forms authentication used to protect the pages on the site.
I was able to implement fairly easily using a wildcard mapping within IIS that routes everything through asp.net's dll. I am only having one more small issue that I was hoping someone might have a solution for.
When a user attempts to access the resource and is not logged in they will be redirected to login.aspx. For example, if the uses attempts to access http://www.mywebsite.com/files/document1.doc, she will be redirected to http://www.mywebsite.com/login.aspx?returnUrl=/files/document1.doc . Once the user enters her credentials the file begins to download or load. Depending on how the user's browser is configured, the user is not directed away from the login page, even though they successfully authenticated. If the user clicks the login button again, out of confusion, the file downloads again. Is there a way to redirect the user after login without affecting the download?