Javascript (Sencha) Web 应用程序的 WCF 身份验证

发布于 2024-12-07 09:05:45 字数 300 浏览 0 评论 0原文

我使用 Javascript(Sencha)/HTML5 开发一个带有 WCF Rest 服务的移动 Web 应用程序,该应用程序需要使用身份验证来对自定义 (MySQL) 数据库中的用户进行身份验证,以便在用户会话期间自定义服务响应。

我搜索了 WCF 身份验证并找到了很多方法,以至于我真的找不到解决我的约束的最佳方法...

我真的可以从 WCF Web 服务(使用他的用户名和密码)对我的用户进行身份验证,然后保留一个令牌或 cookie 或任何可以在以下请求中使用的内容,以便识别我的用户并根据该用户做出响应?

预先感谢您的帮助!

I work on a mobile web app in Javascript(Sencha)/HTML5 with WCF Rest services that needs to use authentication to authenticate users from a custom (MySQL) database in order to customize services responses during the user session.

I search about WCF authentication and founded so many ways that i'am really lost to find the best way to answer my constraints...

Can i really authenticate my user from the WCF web service (with his username and password) and then keep a token or a cookie or whatever that can be used in the following request in order to identify my user and make my response according to that user ?

Thanks in advance for your help !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悍妇囚夫 2024-12-14 09:05:45

正如您所知,身份验证可以通过多种方式完成。用户名/密码、证书等。这实际上取决于您的要求。

例如
如果您有一个处理用户财务信息(例如银行帐户)的移动应用程序,那么我将同时使用用户凭据和 X509Certificates。

如果您有一个面向公众的应用程序,那么您可以只使用证书(Just client certi)。

如果您有 B2B 应用程序(在本例中我对此表示怀疑),那么您可以使用非对称证书(客户端和服务器),在其中您将创建客户端和服务器证书 (X509) 并提供给客户端并让客户端手动安装它在他们的客户端设备上。

对于最简单的情况,您可以从尝试使用用户名和密码开始。因此,您的客户端应用程序将使用用户名/密码通过服务器上的 WCF 服务进行身份验证。
下面我给你一个很好的起点
http://msdn.microsoft.com/en-us/library/ms733131.aspx
http://www.codeproject.com/KB/WCF/CustomUserNamePassAuth2.aspx

Authentication as you many know can be done in many ways. Username/password, Certificate etc. It really depends upon your requirement.

For e.g.
If you have a mobile application which is dealing with financial information for a user (such as Bank account) then I would use both user credentials as well as X509Certificates.

If you have an application which is public facing then you can get away with using just certificates (Just client certi).

If you have a B2B application (which I would doubt in this case) then you can use Asymantic certificates (Client and server) in which you will create Both Client and Server certifcates (X509) and give to the client and let the client manually install it on their client devices.

For the simplest senario you can start by try using username and password. So your client app will user username/password to authenticate with a WCF Service at server.
Follwing my give you a good starting point
http://msdn.microsoft.com/en-us/library/ms733131.aspx
http://www.codeproject.com/KB/WCF/CustomUserNamePassAuth2.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文