폼 인증이 작동하지 않습니다. SMF가 특정 사용자 역할이 필요한 서버의 * .ism/Manifest 파일에 액세스하려고 시도하면 인증 쿠키가 서버로 전송되지 않습니다.Microsoft Media Platform + 폼 인증
내가하는 일 : 1. RIA WCF를 지원하는 새로운 Silverlight Smooth Streaming 템플릿을 만듭니다. 2. 구성의 web.config는 :
<system.web>
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
</providers>
<properties>
<add name="Gender" />
<add name="Birthday" />
<add name="AvatarPath" />
</properties>
</profile>
<roleManager enabled="true">
<providers>
<clear />
<add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
<add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" />
</providers>
</roleManager>
- 를위한 인증 서비스 및 올바른 사용자 클래스를 추가
는 (3 개 소품을 추가).<connectionStrings> <add name="ApplicationServices" connectionString="Data Source=[SERVER];Initial Catalog=[CATALOG];User ID=[USER];Pwd=[PASSWORD];" providerName="System.Data.SqlClient" />
- 클라이언트 측에서 App.xaml.cs를이 추가 :
public App()
{
//Default things...
InitializeWebContext();
}
private void InitializeWebContext()
{
WebContext webContext = new WebContext();
var fa = new FormsAuthentication();
var ac = new AuthenticationDomainService1();
fa.DomainContext = ac;
fa.Login(new LoginParameters("user", "password"), (y) =>
{
if (!y.HasError)
{
this.RootVisual = new MainPage();
}
}, null);
webContext.Authentication = fa;
ApplicationLifetimeObjects.Add(webContext);
Resources.Add("WebContext", WebContext.Current);
}
액세스가 대상 디렉토리에 web.config 파일에 의해 제한된다
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<authorization>
<allow roles="Role_name" />
<deny users="*" />
</authorization>
</system.web>
</configuration>
사용자는이 역할에 존재합니다.
Xaml (Big Bunny)에 지정된 기본 비디오를 사용할 때 모든 것이 정상입니다. 하지만 mediasource를 내 서버의 제한 구역에 대한 경로로 변경하면 액세스 오류가 발생합니다. 클라이언트 측에서 사용자 자격 증명을 성공적으로 가져옵니다. 내가 RIA WCF의 다른 resctricted 방법 ([RequiresAuthentication])에 대한 액세스를 시도, 클라이언트가 인증 쿠키를 보낼 때 하지만 SMFPlayer 미디어 소스에 액세스하려고 할 때, 그 쿠키 wasn`t가 전송 :
피들러는 다음 일을 보여줍니다.
내가 무엇을 놓쳤는가?