使用 Web 浏览器控件从 Windows 应用程序填充会话变量
我有一个包含 Web 浏览器的 Windows 应用程序,在用户使用 Windows 应用程序登录后,他被重定向到使用 Web 浏览器控件的网站.
I have a windows application that contains a web browser, after the user login using the windows app, he is redirected to a website using a web browser control.
我的问题是,我可以向这个网站发送一个会话变量吗?
My question is, can I send a session variable to this website?
听起来你在做准 单点登录.
如果登录是由站点本身处理的,请设置会话 ID(例如在 cookie 中),在登录时设置会话变量,并在随后通过应用程序与站点交互时识别您的会话(例如使用 cookie)浏览器控制.
If the login is handled by the site itself, set a session ID (e.g. in a cookie), set the session variable on login, and identify your session (e.g. with the cookie) in subsequent interactions with the site through the app's browser control.
如果登录不是由站点本身处理的,则考虑在现有登录步骤之后对站点进行级联/辅助登录(即类似地设置会话 ID 并随后能够在与站点交互时通过以下方式识别它)应用的浏览器控件).
If the login is not handled by the site itself, then consider a cascading/secondary login against the site following the existing login step (i.e. to similarly set a session ID and be able to subsequently identify it in interactions with the site through the app's browser control).
或者考虑将您的应用和网站与真正的 SSO 集成 - 例如Shibboleth.环顾网络,您会发现许多关于利用 SSO 与 .NET.
Or consider integrating your app and your site with real SSO - e.g. Shibboleth. Look around the Web, and you find many resources on leveraging SSO with .NET.