コード例 #1
0
        internal BasicAuthenticationMiddleware(Func<IDictionary<string, object>, Task> next,
            BasicAuthenticationProtocol protocol)
        {
            if (next == null)
            {
                throw new ArgumentNullException("next");
            }

            if (protocol == null)
            {
                throw new ArgumentNullException("protocol");
            }

            _next = next;
            _protocol = protocol;
        }
コード例 #2
0
        internal BasicAuthenticationMiddleware(Func <IDictionary <string, object>, Task> next,
                                               BasicAuthenticationProtocol protocol)
        {
            if (next == null)
            {
                throw new ArgumentNullException("next");
            }

            if (protocol == null)
            {
                throw new ArgumentNullException("protocol");
            }

            _next     = next;
            _protocol = protocol;
        }
コード例 #3
0
        public BasicAuthenticationMiddleware(Func<IDictionary<string, object>, Task> next,
            BasicAuthenticationOptions options)
        {
            if (next == null)
            {
                throw new ArgumentNullException("next");
            }

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

            if (options.Provider == null)
            {
                // TODO: Get error messages from resources.
                throw new ArgumentException("BasicAuthenticationOptions.Provider must not be null.", "options");
            }

            _next = next;
            _protocol = new BasicAuthenticationProtocol(options.Provider, options.Realm);
        }
コード例 #4
0
        public BasicAuthenticationMiddleware(Func <IDictionary <string, object>, Task> next,
                                             BasicAuthenticationOptions options)
        {
            if (next == null)
            {
                throw new ArgumentNullException("next");
            }

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

            if (options.Provider == null)
            {
                // TODO: Get error messages from resources.
                throw new ArgumentException("BasicAuthenticationOptions.Provider must not be null.", "options");
            }

            _next     = next;
            _protocol = new BasicAuthenticationProtocol(options.Provider, options.Realm);
        }