/// <summary> /// Adds a new instance of the OAuth2 introspection middleware in the ASP.NET 5 pipeline. /// </summary> /// <param name="app">The application builder.</param> /// <param name="configuration">The delegate used to configure the introspection options.</param> /// <returns>The application builder.</returns> public static IApplicationBuilder UseOAuthIntrospection( [NotNull] this IApplicationBuilder app, [NotNull] Action<OAuthIntrospectionOptions> configuration) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } var options = new OAuthIntrospectionOptions(); configuration(options); return app.UseOAuthIntrospection(options); }