开发者

Authentication on non-local server with WCF RIA services (Silverlight 4)

开发者 https://www.devze.com 2023-01-19 16:12 出处:网络
I\'m building a site using WCF RIA services and Silverlight 4.My user database, the standard ASPNETDB user store, is on my server, which is not on my local development machine.I\'ve created a new proj

I'm building a site using WCF RIA services and Silverlight 4. My user database, the standard ASPNETDB user store, is on my server, which is not on my local development machine. I've created a new project using the Silverlight Business Application template. I'm still becoming familiar with how to develop for WCF RIA so bear with me. I'd like to point to the mentioned ASPNETDB on my server so that I can create users and authenticate both via my web app AND the ASP.NET web site administration tool. To do so, I've edited my Web.config as follows:

<membership defaultProvider="MySqlMembershipProvider" userIsOnlineTimeWindow="15">
   <providers>
     <add name="MySqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionString="myConnectionString" applicationName="riaSilverlightSite"/>
   </providers>
 </membership>

And I've added my server DB's connection string to the Web.config as well...

<add name="myConnectionString" connectionString="Data Source=server\SQLEXPRESS,2301;Database=aspnetdb;Integrated Security=SSPI;"/>

When I try to access the data store via the ASP.NET web site admin tool, I get the following error: "There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirecte开发者_如何学JAVAd to a page where you can choose a new data store.

The following message may help in diagnosing the problem: An error occurred while attempting to initialize a System.Data.SqlClient.SqlConnection object. The value that was provided for the connection string may be wrong, or it may contain an invalid syntax. Parameter name: connectionString"

  1. Is this tool still usable when developing an application using WCF RIA services?
  2. Do I need to make other changes in the Web.config to enable the adding/editing of users/roles with this tool?
  3. Do I need to create other classes specific to the WCF RIA project structure to facilitate my custom provider? (i.e. domain service classes, etc.)

Thanks in advance. Let me know if my questions need clarification.


If your DB is not on the web server you cannot use impersonation to use SSPI authentication. Impersonation works up to IIS and web server box but cannot be propagated to SQL Server on a different machine.

This is a common problem and I am not aware of any solution for it so far. You have to rely on identity of your web application to do the authentication for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号