public static IAppBuilder UseSaml2BearerAuthentication(this IAppBuilder app, Uri audience, string issuerThumbprint, string issuerName = null, X509CertificateValidator validator = null) { var handler = new HttpSaml2SecurityTokenHandler(); ConfigureHandler(handler, audience, issuerThumbprint, issuerName, validator); return(app.UseTokenHandlerAuthentication(handler)); }
public static void AddSaml2(this AuthenticationConfiguration configuration, SecurityTokenHandlerConfiguration handlerConfiguration, AuthenticationOptions options, AuthenticationScheme scheme) { var handler = new HttpSaml2SecurityTokenHandler(); handler.Configuration = handlerConfiguration; configuration.AddMapping(new AuthenticationOptionMapping { TokenHandler = new SecurityTokenHandlerCollection { handler }, Options = options, Scheme = scheme }); }