public TenantMiddleware( RequestDelegate next, TenantService tenantService, IAuthenticationSchemeProvider oauthProvider, IMemoryCache memoryCache, IdentityServerOptions identityServerOptions, IOptionsMonitor <AmazonAuthenticationOptions> amazonOptions, IOptionsMonitor <FacebookOptions> facebookOptions, IOptionsMonitor <GitHubOptions> githubOptions, IOptionsMonitor <GitterAuthenticationOptions> gitterOptions, IOptionsMonitor <GoogleOptions> googleOptions, IOptionsMonitor <InstagramAuthenticationOptions> instagramOptions, IOptionsMonitor <LinkedInAuthenticationOptions> linkedinOptions, IOptionsMonitor <MicrosoftAccountOptions> microsoftOptions, IOptionsMonitor <PaypalAuthenticationOptions> paypalOptions, IOptionsMonitor <QQOptions> qqOptions, IOptionsMonitor <RedditAuthenticationOptions> redditOptions, IOptionsMonitor <SalesforceAuthenticationOptions> salesforceOptions, IOptionsMonitor <TwitterOptions> twitterOptions, IOptionsMonitor <VisualStudioAuthenticationOptions> visualstudioOptions, IOptionsMonitor <WeiboOptions> weiboOptions, IOptionsMonitor <WeixinOptions> weixinOptions, IOptionsMonitor <WordPressAuthenticationOptions> wordpressOptions ) { _next = next; _tenantService = tenantService; _oauthProvider = oauthProvider; _memoryCache = memoryCache; _identityServerOptions = identityServerOptions; _amazonOptions = amazonOptions.CurrentValue; _facebookOptions = facebookOptions.CurrentValue; _githubOptions = githubOptions.CurrentValue; _gitterOptions = gitterOptions.CurrentValue; _googleOptions = googleOptions.CurrentValue; _instagramOptions = instagramOptions.CurrentValue; _linkedinOptions = linkedinOptions.CurrentValue; _microsoftOptions = microsoftOptions.CurrentValue; _paypalOptions = paypalOptions.CurrentValue; _qqOptions = qqOptions.CurrentValue; _redditOptions = redditOptions.CurrentValue; _salesforceOptions = salesforceOptions.CurrentValue; _twitterOptions = twitterOptions.CurrentValue; _visualstudioOptions = visualstudioOptions.CurrentValue; _weiboOptions = weiboOptions.CurrentValue; _weixinOptions = weixinOptions.CurrentValue; _wordpressOptions = wordpressOptions.CurrentValue; }
/// <summary> /// Adds the <see cref="VisualStudioAuthenticationMiddleware"/> middleware to the specified /// <see cref="IApplicationBuilder"/>, which enables VisualStudio authentication capabilities. /// </summary> /// <param name="app">The <see cref="IApplicationBuilder"/> to add the middleware to.</param> /// <param name="options">A <see cref="VisualStudioAuthenticationOptions"/> that specifies options for the middleware.</param> /// <returns>A reference to this instance after the operation has completed.</returns> public static IApplicationBuilder UseVisualStudioAuthentication( [NotNull] this IApplicationBuilder app, [NotNull] VisualStudioAuthenticationOptions options) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } return(app.UseMiddleware <VisualStudioAuthenticationMiddleware>(Options.Create(options))); }
/// <summary> /// Adds the <see cref="VisualStudioAuthenticationMiddleware"/> middleware to the specified /// <see cref="IApplicationBuilder"/>, which enables VisualStudio authentication capabilities. /// </summary> /// <param name="app">The <see cref="IApplicationBuilder"/> to add the middleware to.</param> /// <param name="configuration">An action delegate to configure the provided <see cref="VisualStudioAuthenticationOptions"/>.</param> /// <returns>A reference to this instance after the operation has completed.</returns> public static IApplicationBuilder UseVisualStudioAuthentication( [NotNull] this IApplicationBuilder app, [NotNull] Action <VisualStudioAuthenticationOptions> configuration) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } var options = new VisualStudioAuthenticationOptions(); configuration(options); return(app.UseMiddleware <VisualStudioAuthenticationMiddleware>(Options.Create(options))); }