最后我用小提琴手来看看这是工作了自我要求的差异,唯一的区别托管RIA服务和外部之一,唯一的区别是HTTP引用头。 RIA RequiresAuthentication属性将引用标头考虑进去似乎很奇怪,所以也许完全是另一回事。
我能够找到一种方法将我的域和身份验证服务整合到一个域中,并允许将它托管在不同的web应用程序中,这非常方便。该方法是将AuthenticationDomainService放入主域服务中。它不允许客户端使用相同的使用模式,认证是实体加载操作,但它仍然使得使用ASP.Net成员资格提供程序进行认证变得很容易。
[EnableClientAccess]
public class MyDomainService : LinqToEntitiesDomainService<MyEntities>, IAuthentication<User>
{
public class AuthenticationDomainService : AuthenticationBase<User>
{ }
private AuthenticationDomainService m_authService = new AuthenticationDomainService();
public User Login(string username, string password, bool isPersistent, string customData)
{
return m_authService.Login(username, password, isPersistent, customData);
}
....
不确定这适用于单独的Web项目。 http://www.blogs.victorero.com/2010/04/20/CreatingASilverlightApplicationWithAWCFRIAServicesClassLibrary.aspx – 2011-03-24 00:57:19
它不适用。我已经在Silverlight客户端中提供了我的RIA服务类。 – sipwiz 2011-03-24 01:04:24