Silverlight/RIA-Services 应用程序中的 SQL Server 身份验证

发布于 2024-09-04 22:59:53 字数 363 浏览 2 评论 0 原文

我正在使用 RIA 服务创建一个新的 Silverlight 4 业务应用程序。这将使用 SQL-Server 2005 数据库。没有 AD 设置,因此我需要使用 SQL Server 身份验证。用户用于登录系统的详细信息将用于访问 SQL Server。

例如,如果在应用程序的登录屏幕中输入用户名=“TestUser”和密码=“Password”,则这些将是用于访问数据库的凭据。

我想知道做到这一点的最佳方法是什么?此时访问数据库的方法尚未确定(EF 或使用存储过程的“传统”ADO.NET)。

我认为当前的应用程序采用在登录屏幕中输入的用户名和密码,使用它们来构建连接字符串,并查看它们是否可以使用它来访问数据库,如果有效,则可以进入,如果不能,则被拒绝。

I am creating a new Silverlight 4 business application using RIA services. This will be using a SQL-Server 2005 DB. There is no AD setup so I am required to use SQL Server Authentication. The details that the user uses to login to the system will be used to hit the SQL Server.

E.g., if username="TestUser" and password="Password" is entered in the login screen of the application, these will be the credentials that will be used to access the DB.

I am wondering what the best way to do this will be? At this point the method of accessing the DB is undecided (EF or 'traditional' ADO.NET using stored procs).

I think current applications take the username and password entered into the login screen, use them to build a connection string and see if they can hit the DB using this, if it works they're in, if not they're declined.

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

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

发布评论

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

评论(1

始终不够爱げ你 2024-09-11 22:59:54

我最终选择使用 EF 并更改 AuthenticationServices Login() 方法以尝试使用所需的用户名和密码访问数据库。

我写了一篇关于我如何 动态更改 EF 的连接字符串

I ended up going with EF and changing the AuthenticationServices Login() method to attempt to hit the database with the required username and password.

I wrote a blog post about how I Dynamically changed connection string for EF

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