Ejemplo n.º 1
0
        public static Task GetAuthenticationTypes(this HttpContextBase context,
                                                  Action <IDictionary <string, object>, object> callback, object state)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            OwinRequest request = GetOwinRequest(context);

            return(request.GetAuthenticationTypes(callback, state));
        }
Ejemplo n.º 2
0
        public IEnumerable <AuthenticationDescription> GetAuthenticationTypes(Func <AuthenticationDescription, bool> predicate)
        {
            // TODO: refactor the signature to remove the .Wait() on this call path
            var descriptions = new List <AuthenticationDescription>();

            _request.GetAuthenticationTypes((properties, _) =>
            {
                var description = new AuthenticationDescription(properties);
                if (predicate(description))
                {
                    descriptions.Add(description);
                }
            }, null).Wait();
            return(descriptions);
        }