Example #1
0
        static server()
        {
            PersonFetchHandler handler = personId =>{
                return new Person{
                    Id = 1,
                    Enabled = true,
                    Name = "刘铭",
                    Sex = 1,
                    Username = "******"
                };
            };

            SSOLoginHandler ssoHandler = (user, pwd) =>
            {
                return 1;
            };

            SessionSington = new SessionServer(handler, ssoHandler,"123456",null);

        }
Example #2
0
        internal RequestHandle(IPlugin plugin)
        {
            this._plugin = plugin;


            PersonFetchHandler ph = a =>
            {
                return new Person
                {
                    Id = a,
                    Name = "用户A"
                };
            };

            SSOLoginHandler lh = (usr, pwd) =>
            {
                return 1;
            };

            ISessionSet set = SessionManager.GetDefaultSessionSet();
            this._serve = new SessionServer(set, ph, lh, "123456", "tmpsso");
            this._serve.RegisterClient("http://localhost:8001/sso_api");
        }