Beispiel #1
0
        public HttpResponseMessage Login([FromBody] UsersModel item)
        {
            var results = _process.LoginValidate(Login: item.Login, Password: new EncryptStrings().EncryptInfo(sSText1: item.Login, sSText2: item.Password));
            var item2   = new Gesi.Core.Web.Model.SessionUsersModel
            {
                Creation   = results.Creation,
                Expiration = results.Expiration,
                IsActive   = results.IsActive,
                Name       = results.Name,
                Profile    = results.Profile,
                ProfileId  = results.ProfileId,
                SessionId  = results.SessionId,
                Token      = results.Token,
                Updated    = results.Updated,
                UpdatedId  = results.UpdatedId,
                UserId     = results.UserId,
                Section    = results.Section
            };
            var data = SessionTokenJWT(item2);

            return(Request.CreateResponse(HttpStatusCode.OK, new
            {
                data
            }));
        }
Beispiel #2
0
        public HttpResponseMessage RefreshToken([FromBody] UsersModel item)
        {
            var data  = _process.SSUsersSessionValidate(item.Login, Session);
            var item2 = new Gesi.Core.Web.Model.SessionUsersModel
            {
                Creation   = data.Creation,
                Expiration = data.Expiration,
                IsActive   = data.IsActive,
                Name       = data.Name,
                Profile    = data.Profile,
                ProfileId  = data.ProfileId,
                SessionId  = data.SessionId,
                Token      = data.Token,
                Updated    = data.Updated,
                UpdatedId  = data.UpdatedId,
                UserId     = data.UserId
            };
            var result = this.SessionTokenJWT(item2);

            return(Request.CreateResponse(HttpStatusCode.OK, new
            {
                result
            }));
        }