本文整理汇总了C#中Thinktecture.IdentityServer.Core.Configuration.IdentityServerOptions.AdditionalIdentityProviderConfiguration方法的典型用法代码示例。如果您正苦于以下问题:C# IdentityServerOptions.AdditionalIdentityProviderConfiguration方法的具体用法?C# IdentityServerOptions.AdditionalIdentityProviderConfiguration怎么用?C# IdentityServerOptions.AdditionalIdentityProviderConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thinktecture.IdentityServer.Core.Configuration.IdentityServerOptions
的用法示例。
在下文中一共展示了IdentityServerOptions.AdditionalIdentityProviderConfiguration方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UseIdentityServer
public static IAppBuilder UseIdentityServer(this IAppBuilder app, IdentityServerOptions options)
{
if (options == null) throw new ArgumentNullException("options");
var internalConfig = new InternalConfiguration();
if (options.DataProtector == null)
{
var provider = app.GetDataProtectionProvider();
if (provider == null)
{
provider = new DpapiDataProtectionProvider("idsrv3");
}
internalConfig.DataProtector = new HostDataProtector(provider);
}
else
{
internalConfig.DataProtector = options.DataProtector;
}
// thank you Microsoft for the clean syntax
JwtSecurityTokenHandler.InboundClaimTypeMap = ClaimMappings.None;
JwtSecurityTokenHandler.OutboundClaimTypeMap = ClaimMappings.None;
app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = Constants.PrimaryAuthenticationType, CookieName = Constants.PrimaryAuthenticationType });
app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = Constants.ExternalAuthenticationType, CookieName = Constants.ExternalAuthenticationType, AuthenticationMode = AuthenticationMode.Passive });
app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = Constants.PartialSignInAuthenticationType, CookieName = Constants.PartialSignInAuthenticationType, AuthenticationMode = AuthenticationMode.Passive });
if (options.ConfigurePlugins != null)
{
options.ConfigurePlugins(app, options);
}
if (options.AdditionalIdentityProviderConfiguration != null)
{
options.AdditionalIdentityProviderConfiguration(app, Constants.ExternalAuthenticationType);
}
app.UseFileServer(new FileServerOptions
{
RequestPath = new PathString("/assets"),
FileSystem = new EmbeddedResourceFileSystem(typeof(Constants).Assembly, "Thinktecture.IdentityServer.Core.Assets")
});
app.UseStageMarker(PipelineStage.MapHandler);
app.UseFileServer(new FileServerOptions
{
RequestPath = new PathString("/assets/libs/fonts"),
FileSystem = new EmbeddedResourceFileSystem(typeof(Constants).Assembly, "Thinktecture.IdentityServer.Core.Assets.libs.bootstrap.fonts")
});
app.UseStageMarker(PipelineStage.MapHandler);
app.Use<AutofacContainerMiddleware>(AutofacConfig.Configure(options, internalConfig));
Microsoft.Owin.Infrastructure.SignatureConversions.AddConversions(app);
app.UseWebApi(WebApiConfig.Configure());
return app;
}
示例2: UseIdentityServer
public static IAppBuilder UseIdentityServer(this IAppBuilder app, IdentityServerOptions options)
{
if (app == null) throw new ArgumentNullException("app");
if (options == null) throw new ArgumentNullException("options");
options.Validate();
// turn off weird claim mappings for JWTs
JwtSecurityTokenHandler.InboundClaimTypeMap = ClaimMappings.None;
JwtSecurityTokenHandler.OutboundClaimTypeMap = ClaimMappings.None;
options.ProtocolLogoutUrls.Add(Constants.RoutePaths.Oidc.EndSessionCallback);
app.ConfigureDataProtectionProvider(options);
app.ConfigureIdentityServerBaseUrl(options.PublicHostName);
app.UseCors(options.CorsPolicy);
app.ConfigureCookieAuthentication(options.CookieOptions);
if (options.PluginConfiguration != null)
{
options.PluginConfiguration(app, options);
}
if (options.AdditionalIdentityProviderConfiguration != null)
{
options.AdditionalIdentityProviderConfiguration(app, Constants.ExternalAuthenticationType);
}
app.UseEmbeddedFileServer();
app.Use<AutofacContainerMiddleware>(AutofacConfig.Configure(options));
SignatureConversions.AddConversions(app);
app.UseWebApi(WebApiConfig.Configure());
return app;
}