Answered by:
ClickOnce appication and Browser cookies

Question
-
Is it possible for a clickonce application to read browser cookies of the server that delivered the application? We have a scenario where the application is behind a proxy that sets cookies for user authentication and load-balancing. However, we notice that once the Browser launches the ClickOnce application, the application stops sending these cookies.
Some online threads have suggested that ClickOnce may work with 407 proxy authentication required challenge from proxies. However, this is not an ideal solution as the user is already authenticated in the browser, so why should the user be challenged again? Using NTLM or Kerberos authentication is also out of question as this proxy is servicing clients over the internet.
Is there a modification that can be done to deployment manifest or application manifest that will allow the the ClickOnce application to read the cookies of the application domain set in the browser cache?
- Moved by Xavier Xie-MSFT Wednesday, January 6, 2016 5:40 AM move to correct forum
Tuesday, January 5, 2016 12:30 AM
Answers
-
there is a win api InternetGetCookies which could use in windows form application.
but i don't sure it could be use in clickonce app since some security reason.
you might try it..
http://www.pinvoke.net/default.aspx/wininet/InternetGetCookie.html
DON'T TRY SO HARD,THE BEST THINGS COME WHEN YOU LEAST EXPECT THEM TO.
- Proposed as answer by Herro wongMicrosoft contingent staff Monday, January 18, 2016 8:56 AM
- Marked as answer by Herro wongMicrosoft contingent staff Monday, January 18, 2016 9:00 AM
Thursday, January 7, 2016 4:28 AM
All replies
-
it's not easy work.
but follows article provides a approach
http://www.codeproject.com/Articles/24519/Make-ClickOnce-Work-With-ASP-NET-Forms-Authenticat
AND ,BTW. i have a question.
Does the ClickOnce has right to perform PInvoke?
DON'T TRY SO HARD,THE BEST THINGS COME WHEN YOU LEAST EXPECT THEM TO.
- Edited by Matthew LEAN . D Tuesday, January 5, 2016 2:26 AM
Tuesday, January 5, 2016 2:24 AM -
Thank you Matthew
Its interesting approach, but we do not have control on the server. I wonder how a reverse proxy can provide access to users from the web without requiring any modification on the application server.
I was hoping there was a application manifest configuration file that can be changed to let the launched application on the client to read application cookies from the browser. We notice that Word or Excel launched from a SharePoint server are able to do this for trusted sites. But the ClickOnce applications are not allowed to read the cookies even for trusted sites.
- Edited by Hemanth Kavuluru Wednesday, January 6, 2016 11:12 PM
Wednesday, January 6, 2016 11:11 PM -
there is a win api InternetGetCookies which could use in windows form application.
but i don't sure it could be use in clickonce app since some security reason.
you might try it..
http://www.pinvoke.net/default.aspx/wininet/InternetGetCookie.html
DON'T TRY SO HARD,THE BEST THINGS COME WHEN YOU LEAST EXPECT THEM TO.
- Proposed as answer by Herro wongMicrosoft contingent staff Monday, January 18, 2016 8:56 AM
- Marked as answer by Herro wongMicrosoft contingent staff Monday, January 18, 2016 9:00 AM
Thursday, January 7, 2016 4:28 AM