Esempio n. 1
0
 public ApiBasicValidateIdentityContext(IOwinContext context, ApiBasicAuthenticationOptions options, String clientId, String clientSecret, String host)
 {
     Options      = options;
     ClientId     = clientId;
     ClientSecret = clientSecret;
     Host         = host;
 }
Esempio n. 2
0
        public static IAppBuilder UseApiBasicAuthentication(this IAppBuilder app, ApiBasicAuthenticationOptions options = null)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }

            if (options == null)
            {
                options = new ApiBasicAuthenticationOptions();
            }

            app.Use <ApiBasicAuthenticationMiddleware>(app, options);
            app.UseStageMarker(PipelineStage.Authenticate);

            return(app);
        }