public static IApplicationBuilder UseMicrosoftAccountAuthentication([NotNull] this IApplicationBuilder app, Action<MicrosoftAccountOptions> configureOptions)
 {
     var options = new MicrosoftAccountOptions();
     if (configureOptions != null)
     {
         configureOptions(options);
     }
     return app.UseMicrosoftAccountAuthentication(options);
 }
 public MultiTenantMicrosoftOptionsResolver(
     MicrosoftAccountOptions originalOptions,
     ISiteResolver siteResolver,
     ISiteRepository siteRepository,
     MultiTenantOptions multiTenantOptions)
 {
     this.originalOptions = originalOptions;
     this.siteResolver = siteResolver;
     this.multiTenantOptions = multiTenantOptions;
     siteRepo = siteRepository;
 }
 public MultiTenantMicrosoftOptionsResolver(
     MicrosoftAccountOptions originalOptions,
     //ISiteResolver siteResolver,
     //ISiteRepository siteRepository,
     ISiteSettings currentSite,
     MultiTenantOptions multiTenantOptions)
 {
     this.originalOptions = originalOptions;
     //this.siteResolver = siteResolver;
     site = currentSite;
     this.multiTenantOptions = multiTenantOptions;
     //siteRepo = siteRepository;
 }
        /// <summary>
        /// Adds the <see cref="MicrosoftAccountMiddleware"/> middleware to the specified <see cref="IApplicationBuilder"/>, which enables Microsoft Account authentication capabilities.
        /// </summary>
        /// <param name="app">The <see cref="IApplicationBuilder"/> to add the middleware to.</param>
        /// <param name="configureOptions">An action delegate to configure the provided <see cref="MicrosoftAccountOptions"/>.</param>
        /// <returns>A reference to this instance after the operation has completed.</returns>
        public static IApplicationBuilder UseMicrosoftAccountAuthentication(this IApplicationBuilder app, Action<MicrosoftAccountOptions> configureOptions)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }

            var options = new MicrosoftAccountOptions();
            if (configureOptions != null)
            {
                configureOptions(options);
            }
            return app.UseMicrosoftAccountAuthentication(options);
        }
        /// <summary>
        /// Adds the <see cref="MicrosoftAccountMiddleware"/> middleware to the specified <see cref="IApplicationBuilder"/>, which enables Microsoft Account authentication capabilities.
        /// </summary>
        /// <param name="app">The <see cref="IApplicationBuilder"/> to add the middleware to.</param>
        /// <param name="options">A <see cref="MicrosoftAccountOptions"/> that specifies options for the middleware.</param>
        /// <returns>A reference to this instance after the operation has completed.</returns>
        public static IApplicationBuilder UseMicrosoftAccountAuthentication(this IApplicationBuilder app, MicrosoftAccountOptions options)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            return app.UseMiddleware<MicrosoftAccountMiddleware>(options);
        }
예제 #6
0
        public static IApplicationBuilder UseMultiTenantMicrosoftAccountAuthentication(
            this IApplicationBuilder app, 
            Action<MicrosoftAccountOptions> configureOptions)
        {
            //https://github.com/aspnet/Security/blob/582f562bbb20fc76f37023086e2b2d861eb4d43d/src/Microsoft.AspNet.Authentication.MicrosoftAccount/MicrosoftAccountOptions.cs
            //https://github.com/aspnet/Security/blob/582f562bbb20fc76f37023086e2b2d861eb4d43d/src/Microsoft.AspNet.Authentication.MicrosoftAccount/MicrosoftAccountDefaults.cs

            var options = new MicrosoftAccountOptions();
            if (configureOptions != null)
            {
                configureOptions(options);
            }

            return app.UseMiddleware<MultiTenantMicrosoftAccountMiddleware>(options);

        }