简体   繁体   English

如何在Webform和Winform之间共享凭据?

[英]How to share the credentials between Webform and Winform?

I want to make a login form at the Clickonce deployment webpage, and only allow the authenticated users to download the application. 我想在Clickonce部署网页上创建一个登录表单,并且只允许经过身份验证的用户下载该应用程序。 and I want the downloaded application to use the same credentials entered at the webpage, without prompting the users to enter the credentials again. 我希望下载的应用程序使用在网页上输入的相同凭据,而不提示用户再次输入凭据。

Details: 细节:
I have an application(Windows Client) which needs customized settings for different users. 我有一个需要针对不同用户的自定义设置的应用程序(Windows客户端)。 the application is deployed through ClickOnce. 该应用程序是通过ClickOnce部署的。

Currently, the users are given the ClickOnce webpage URL, then download the application from there. 当前,为用户提供ClickOnce网页URL,然后从那里下载应用程序。 after download and running the application, the application prompts users with a login form. 下载并运行该应用程序后,该应用程序将使用登录表单提示用户。 If their credentials are authenticated, the application loads the customized settings from the server's database according to the credentials given. 如果其凭据已通过身份验证,则应用程序将根据给定的凭据从服务器的数据库中加载自定义设置。

The problem is, any unauthenticated users can download the application if they just know the ClickOnce deployement webpage's URL. 问题是,任何未经身份验证的用户只要知道ClickOnce部署网页的URL,都可以下载该应用程序。

Unauthenticated users won't be able to run the application anyways, because the application asks for credentials when started, but I want to prevent the unauthenticated users from downloading the application at all. 未经身份验证的用户无论如何都将无法运行该应用程序,因为该应用程序在启动时会要求提供凭据,但我想完全阻止未经身份验证的用户下载该应用程序。

The webpage needs to be customized for each users, so the login at the webpage is necessary. 需要为每个用户自定义该网页,因此必须登录该网页。

Am I asking the wrong question maybe? 我是不是问错了问题? English is not my native language so please understand. 英语不是我的母语,所以请理解。
Your help is much appreciated! 非常感谢您的帮助!

Just implement security in your windows application. 只需在Windows应用程序中实现安全性即可。 If users cannot use it without authenticating against your web services, then there is no use of them downloading the app. 如果用户在未通过您的Web服务验证的情况下无法使用它,那么他们将无需下载应用程序。 I feel there is no need to authenticate them twice. 我觉得没有必要对它们进行两次身份验证。

Hmmmm. Pretty much the same answers you got in the MSDN ClickOnce forum. 您在MSDN ClickOnce论坛中获得的答案几乎相同。 Windows authentication or nothing. Windows身份验证或什么都不做。 ;-) ;-)

Regarding the answer with the link -- I wouldn't use query parameters. 关于链接的答案-我不会使用查询参数。 Anybody can type in the link to the C/O application and add the query parameters. 任何人都可以输入到C / O应用程序的链接并添加查询参数。

Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM