不幸的是,某些RAC片段不提供SignalProducer
,但Signal
s(Action
}的values
字段为Signal
。SignalProducer
。但是根据我的逻辑,我需要Signal
。
如何将SignalProducer
转换为toSignalProducer(toRACSignal(x))
?
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions { });
app.UseWsFederationAuthentication(
new WsFederationAuthenticationOptions
{
Wtrealm = ConfigurationManager.AppSettings["ida:Audience"],
AuthenticationType = WsFederationAuthenticationDefaults.AuthenticationType,
TokenValidationParameters = new TokenValidationParameters
{
SaveSigninToken = true,
ValidAudience = ConfigurationManager.AppSettings["ida:Audience"],
},
Configuration = getWsFederationConfiguration()
}
);
}
private static WsFederationConfiguration getWsFederationConfiguration()
{
WsFederationConfiguration configuration = new WsFederationConfiguration
{
Issuer = ConfigurationManager.AppSettings["wsFederation:trustedIssuer"],
TokenEndpoint = ConfigurationManager.AppSettings["wsFederation:issuer"],
};
configuration.SigningKeys.Add(new X509SecurityKey(new X509Certificate2(Convert.FromBase64String(ConfigurationManager.AppSettings["wsFederation:trustedIssuerSigningKey"]))));
return configuration;
}
似乎不是一个好的解决方案
答案 0 :(得分:0)
目前我停止了此扩展程序:
extension Signal {
func toSignalProducer() -> SignalProducer<T, E> {
return SignalProducer { (sink, compositeDisposable) in
compositeDisposable.addDisposable(self.observe(sink))
}
}
}