Example #1
0
        public static IApplicationBuilder UseDropboxAuthentication(
            [NotNull] this IApplicationBuilder app,
            [NotNull] Action <DropboxAuthenticationOptions> configuration)
        {
            var options = new DropboxAuthenticationOptions();

            configuration(options);

            return(app.UseMiddleware <DropboxAuthenticationMiddleware>(options));
        }
Example #2
0
        /// <summary>
        /// Adds the <see cref="DropboxAuthenticationMiddleware"/> middleware to the specified <see cref="IApplicationBuilder"/>, which enables Dropbox authentication capabilities.
        /// </summary>
        /// <param name="app">The <see cref="IApplicationBuilder"/> to add the middleware to.</param>
        /// <param name="options">A <see cref="DropboxAuthenticationOptions"/> that specifies options for the middleware.</param>
        /// <returns>A reference to this instance after the operation has completed.</returns>
        public static IApplicationBuilder UseDropboxAuthentication(
            [NotNull] this IApplicationBuilder app,
            [NotNull] DropboxAuthenticationOptions options)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }

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

            return(app.UseMiddleware <DropboxAuthenticationMiddleware>(Options.Create(options)));
        }
        public static IAppBuilder UseDropboxAuthentication(
            this IAppBuilder app,
            DropboxAuthenticationOptions options)
        {
            if (app == null)
            {
                throw new ArgumentNullException("app");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            app.Use(typeof(DropboxAuthenticationMiddleware), app, options);
            return(app);
        }
Example #4
0
        /// <summary>
        /// Adds the <see cref="DropboxAuthenticationMiddleware"/> middleware to the specified <see cref="IApplicationBuilder"/>, which enables Dropbox 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="DropboxAuthenticationOptions"/>.</param>
        /// <returns>A reference to this instance after the operation has completed.</returns>
        public static IApplicationBuilder UseDropboxAuthentication(
            [NotNull] this IApplicationBuilder app,
            [NotNull] Action <DropboxAuthenticationOptions> configuration)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }

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

            var options = new DropboxAuthenticationOptions();

            configuration(options);

            return(app.UseMiddleware <DropboxAuthenticationMiddleware>(Options.Create(options)));
        }
Example #5
0
 public static IApplicationBuilder UseDropboxAuthentication(
     [NotNull] this IApplicationBuilder app,
     [NotNull] DropboxAuthenticationOptions options)
 {
     return(app.UseMiddleware <DropboxAuthenticationMiddleware>(options));
 }
 private static void SetupDropboxAuth(IAppBuilder app)
 {
     DropboxAuthenticationOptions dropBoxOptions = new DropboxAuthenticationOptions()
     {
         ClientId = DropboxClientId,
         ClientSecret = DropboxClientSecret
     };
     //Looks like there is a bug in this Nuget Package (submitted issue)
     //app.UseDropboxAuthentication(DropboxClientId, DropboxClientSecret);
 }