本文整理匯總了C#中Thinktecture.IdentityServer.Core.Configuration.IdentityServerOptions.PluginConfiguration方法的典型用法代碼示例。如果您正苦於以下問題:C# IdentityServerOptions.PluginConfiguration方法的具體用法?C# IdentityServerOptions.PluginConfiguration怎麽用?C# IdentityServerOptions.PluginConfiguration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Thinktecture.IdentityServer.Core.Configuration.IdentityServerOptions
的用法示例。
在下文中一共展示了IdentityServerOptions.PluginConfiguration方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: UseIdentityServer
/// <summary>
/// Extension method to configure IdentityServer in the hosting application.
/// </summary>
/// <param name="app">The application.</param>
/// <param name="options">The <see cref="Thinktecture.IdentityServer.Core.Configuration.IdentityServerOptions"/>.</param>
/// <returns></returns>
/// <exception cref="System.ArgumentNullException">
/// app
/// or
/// options
/// </exception>
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;
if (options.RequireSsl)
{
app.Use<RequireSslMiddleware>();
}
app.ConfigureRequestId();
options.ProtocolLogoutUrls.Add(Constants.RoutePaths.Oidc.EndSessionCallback);
app.ConfigureDataProtectionProvider(options);
app.ConfigureIdentityServerBaseUrl(options.PublicOrigin);
app.ConfigureIdentityServerIssuer(options);
var container = AutofacConfig.Configure(options);
app.UseAutofacMiddleware(container);
app.UseCors();
app.ConfigureCookieAuthentication(options.AuthenticationOptions.CookieOptions, options.DataProtector);
if (options.PluginConfiguration != null)
{
options.PluginConfiguration(app, options);
}
if (options.AuthenticationOptions.IdentityProviders != null)
{
options.AuthenticationOptions.IdentityProviders(app, Constants.ExternalAuthenticationType);
}
app.UseEmbeddedFileServer();
SignatureConversions.AddConversions(app);
var httpConfig = WebApiConfig.Configure(options, container);
app.UseAutofacWebApi(httpConfig);
app.UseWebApi(httpConfig);
using (var child = container.CreateScopeWithEmptyOwinContext())
{
var eventSvc = child.Resolve<IEventService>();
DoStartupDiagnostics(options, eventSvc);
}
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;
if (options.RequireSsl)
{
app.Use<RequireSslMiddleware>();
}
options.ProtocolLogoutUrls.Add(Constants.RoutePaths.Oidc.EndSessionCallback);
app.ConfigureDataProtectionProvider(options);
app.ConfigureIdentityServerBaseUrl(options.PublicHostName);
app.ConfigureIdentityServerIssuer(options);
app.UseCors(options.CorsPolicy);
app.ConfigureCookieAuthentication(options.AuthenticationOptions.CookieOptions, options.DataProtector);
if (options.PluginConfiguration != null)
{
options.PluginConfiguration(app, options);
}
if (options.AuthenticationOptions.IdentityProviders != null)
{
options.AuthenticationOptions.IdentityProviders(app, Constants.ExternalAuthenticationType);
}
app.UseEmbeddedFileServer();
app.Use<AutofacContainerMiddleware>(AutofacConfig.Configure(options));
SignatureConversions.AddConversions(app);
app.UseWebApi(WebApiConfig.Configure(options));
return app;
}