本文整理汇总了C#中IAppBuilder.UseWsFederationPlugin方法的典型用法代码示例。如果您正苦于以下问题:C# IAppBuilder.UseWsFederationPlugin方法的具体用法?C# IAppBuilder.UseWsFederationPlugin怎么用?C# IAppBuilder.UseWsFederationPlugin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAppBuilder
的用法示例。
在下文中一共展示了IAppBuilder.UseWsFederationPlugin方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConfigurePlugins
private void ConfigurePlugins(IAppBuilder app, PluginConfiguration dependencies)
{
var options = new WsFederationPluginOptions(dependencies)
{
RelyingPartyService = () => new InMemoryRelyingPartyService(LocalTestRelyingParties.Get()),
};
app.UseWsFederationPlugin(options);
}
示例2: ConfigurePlugins
private void ConfigurePlugins(IAppBuilder app, PluginDependencies dependencies)
{
var options = new WsFederationPluginOptions(dependencies)
{
RelyingPartyService = () => new TestRelyingPartyService(),
};
app.UseWsFederationPlugin(options);
}
示例3: ConfigurePlugins
private void ConfigurePlugins(IAppBuilder pluginApp, IdentityServerOptions options)
{
var wsFedOptions = new WsFederationPluginOptions(options);
// data sources for in-memory services
wsFedOptions.Factory.Register(new Registration<IEnumerable<RelyingParty>>(RelyingParties.Get()));
wsFedOptions.Factory.RelyingPartyService = new Registration<IRelyingPartyService>(typeof(InMemoryRelyingPartyService));
pluginApp.UseWsFederationPlugin(wsFedOptions);
}
示例4: ConfigurePlugins
private void ConfigurePlugins(IAppBuilder pluginApp, IdentityServerOptions options)
{
var wsFedOptions = new WsFederationPluginOptions
{
IdentityServerOptions = options,
Factory = new WsFederationServiceFactory
{
UserService = options.Factory.UserService,
RelyingPartyService = Registration.RegisterFactory<IRelyingPartyService>(() => new InMemoryRelyingPartyService(RelyingParties.Get())),
}
};
pluginApp.UseWsFederationPlugin(wsFedOptions);
}
示例5: ConfigureWsFederation
private void ConfigureWsFederation(IAppBuilder pluginApp, IdentityServerOptions options)
{
var factory = new WsFederationServiceFactory(options.Factory);
factory.RelyingPartyService = new Registration<IRelyingPartyService>(typeof(RelyingPartiesService));
var wsFedOptions = new WsFederationPluginOptions
{
IdentityServerOptions = options,
Factory = factory
};
pluginApp.UseWsFederationPlugin(wsFedOptions);
}
示例6: ConfigurePlugins
private void ConfigurePlugins(IAppBuilder pluginApp, IdentityServerOptions options)
{
var wsFedOptions = new WsFederationPluginOptions
{
// todo - also signoutcleanup is broken right now
LoginPageUrl = "http://localhost:3333/core/login",
LogoutPageUrl = "http://localhost:3333/core/connect/logout",
Factory = new WsFederationServiceFactory
{
UserService = options.Factory.UserService,
CoreSettings = options.Factory.CoreSettings,
RelyingPartyService = Registration.RegisterFactory<IRelyingPartyService>(() => new InMemoryRelyingPartyService(RelyingParties.Get())),
WsFederationSettings = Registration.RegisterFactory<WsFederationSettings>(() => new WsFedSettings())
},
};
pluginApp.UseWsFederationPlugin(wsFedOptions);
}
示例7: PluginConfiguration
private static void PluginConfiguration(IAppBuilder pluginApp, IdentityServerOptions options)
{
var relyingParties = new List<RelyingParty>
{
new RelyingParty
{
Realm = "urn:encryptedrealmV1",
ReplyUrl = "https://localhost:44344/",
TokenType = TokenTypes.Saml11TokenProfile11,
DefaultClaimTypeMappingPrefix = "http://local.schema.org/",
IncludeAllClaimsForUser = true,
ClaimMappings =
new Dictionary<string, string> {
{ "sub", ClaimTypes.NameIdentifier },
{ "name", ClaimTypes.Name },
{ "given_name", ClaimTypes.GivenName },
{ "family_name", ClaimTypes.Surname },
{ "email", ClaimTypes.Email }
},
EncryptingCertificate = Cert.LoadEncrypting()
},
new RelyingParty
{
Realm = "urn:encryptedrealmV2",
ReplyUrl = "https://localhost:44344/",
TokenType = TokenTypes.Saml2TokenProfile11,
DefaultClaimTypeMappingPrefix = "http://local.schema.org/",
IncludeAllClaimsForUser = true,
ClaimMappings =
new Dictionary<string, string> {
{ "sub", ClaimTypes.NameIdentifier },
{ "name", ClaimTypes.Name },
{ "given_name", ClaimTypes.GivenName },
{ "family_name", ClaimTypes.Surname },
{ "email", ClaimTypes.Email }
},
EncryptingCertificate = Cert.LoadEncrypting()
}
};
var factory = new WsFederationServiceFactory(options.Factory);
factory.Register(new Registration<IEnumerable<RelyingParty>>(relyingParties));
factory.RelyingPartyService = new Registration<IRelyingPartyService>(typeof (InMemoryRelyingPartyService));
pluginApp.UseWsFederationPlugin(new WsFederationPluginOptions
{
IdentityServerOptions = options,
Factory = factory,
EnableMetadataEndpoint = true
});
}