/// <summary>
        ///
        /// </summary>
        /// <param name="authenticationTypes"></param>
        /// <param name="callback"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        public async Task Authenticate(string[] authenticationTypes, Action <IIdentity, IDictionary <string, string>, IDictionary <string, object>, object> callback, object state)
        {
            AuthenticateDelegate authenticateDelegate = AuthenticateDelegate;

            if (authenticateDelegate != null)
            {
                await authenticateDelegate.Invoke(authenticationTypes, callback, state);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 一般处理程序调用开始
        /// </summary>
        public void ProcessRequest(HttpContext context)
        {
            if (authenticate != null && !authenticate.Invoke())
            {
                throw new Exception("用户验证失败!");
            }

            String controller = context.Request["c"]; //Controller名称
            String action     = context.Request["a"]; //Action名称
            String param      = context.Request["p"]; //参数

            if (String.IsNullOrEmpty(controller) || String.IsNullOrEmpty(action))
            {
                throw new Exception("调用参数不完整!");
            }

            invokeMethod(controller, action, param);
        }